I had this exact issue. It wasn't a permission problem. The disk of Postgresl was full. When its disk is full, Postgres turns read only.
I added more space to the volume and everything went back to normal.