Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade from awx 13 to 14, postgres failed to restart #7854

Closed
linuxcube opened this issue Aug 6, 2020 · 24 comments
Closed

upgrade from awx 13 to 14, postgres failed to restart #7854

linuxcube opened this issue Aug 6, 2020 · 24 comments

Comments

@linuxcube
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

postgres failed to restart from upgrade of awx v13 to v14

ENVIRONMENT
  • AWX version: 14
  • AWX install method: docker
  • Ansible version: 2.8.3-1
  • Operating System: RHEL 8.2
  • Web Browser: Chrome/Firefox
STEPS TO REPRODUCE

docker stop ansible/awx:14.0.0 ansible/awx:14.0.0 redis postgres:10
rm rf /root/awx
git clone https://github.com/ansible/awx.git
cd awx/installer/
ansible-playbook -i inventory install.yml
docker ps

EXPECTED RESULTS

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e0effec6e2ab ansible/awx:14.0.0 "tini -- /usr/bin/la…" 31 minutes ago Up About a minute 8052/tcp awx_task
a3a328a5ffc3 ansible/awx:14.0.0 "tini -- /bin/sh -c …" 31 minutes ago Up About a minute 0.0.0.0:80->8052/tcp awx_web
8dd7063400a8 postgres:10 "docker-entrypoint.s…" 32 minutes ago Restarting (1) 30 seconds ago awx_postgres
e0eb72177943 redis "docker-entrypoint.s…" 2 weeks ago Up About a minute 6379/tcp awx_redis

ACTUAL RESULTS

postgres stuck in restart mode

ADDITIONAL INFORMATION

No additional details collected

@ryanpetrello
Copy link
Contributor

docker logs 8dd7063400a8 ?

@shanemcd
Copy link
Member

shanemcd commented Aug 6, 2020

Did you copy over your old inventory file with your passwords?

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Aug 6, 2020

What @shanemcd said:

https://github.com/ansible/awx/blob/devel/INSTALL.md#upgrading-from-previous-versions

If you blew away your inventory file, upgrading is unlikely to work.

@awxbot awxbot added the type:bug label Aug 6, 2020
@agrisvv
Copy link

agrisvv commented Aug 6, 2020

centos 8 from awx 13 to 14 after upgrade as usual with old inventory settings.
postgres docker restarting..


Data page checksums are disabled.

initdb: directory "/var/lib/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb
with an argument other than "/var/lib/postgresql/data".
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: directory "/var/lib/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb
with an argument other than "/var/lib/postgresql/data".

@linuxcube
Copy link
Author

linuxcube commented Aug 6, 2020 via email

@linuxcube
Copy link
Author

linuxcube commented Aug 6, 2020 via email

@egmar
Copy link
Contributor

egmar commented Aug 6, 2020

@linuxphone see this change 06fd131 , perhaps its the cause

@agrisvv
Copy link

agrisvv commented Aug 6, 2020

@linuxphone see this change 06fd131 , perhaps its the cause

modified installer reverted changes as in commit and installed again, but now it started with empty db.. will try to check where it gone..

@linuxcube
Copy link
Author

linuxcube commented Aug 6, 2020 via email

@amtilghman
Copy link

amtilghman commented Aug 6, 2020

I tested a devel build 2 days ago and had the same issue, was thinking it would be fixed before 14.0.0 (or i would have made an issue :) )

Just tried 12.0.0 > 14.0.0

Error was identical to person above:

initdb: directory "/var/lib/postgresql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/postgresql/data" or run initdb
with an argument other than "/var/lib/postgresql/data".
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

@linuxcube
Copy link
Author

linuxcube commented Aug 6, 2020 via email

@ekinof
Copy link

ekinof commented Aug 7, 2020

Same with me, I just tried to upgrade from 12.0.0 to 14.0.0, my postgres container doesn't work. I downgrade to 13.0.0 and now it works.

@kenchrcum
Copy link

Hello,
I had the same issue, I solved it by using
docker-compose down && docker-compose up -d
It seemed to me the problem happened because the old AWX was still running when I started the installer.

@Goeger
Copy link

Goeger commented Aug 7, 2020

@linuxphone see this change 06fd131 , perhaps its the cause

had the same issue and to change this file to the old version solved it for me

@dotslashcmd
Copy link

dotslashcmd commented Aug 7, 2020

It seems that in the docker-compose generated by the V14 installer, the env variable PGDATA for the postgres container is missing.

Docker-compose v 13 :

  postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data/pgdata:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      PGDATA: /var/lib/postgresql/data/pgdata
      http_proxy: 
      https_proxy: 
      no_proxy:

Docker-compose v 14 :

postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      http_proxy:
      https_proxy:
      no_proxy:

@linuxcube
Copy link
Author

@linuxphone see this change 06fd131 , perhaps its the cause

had the same issue and to change this file to the old version solved it for me

This didnt fix it for me, I tried putting back the old entries and reinstalling....same issue with postgress...it wont restart normally.

@linuxcube
Copy link
Author

It seems that in the docker-compose generated by the V14 installer, the env variable PGDATA for the postgres container is missing.

Docker-compose v 13 :

  postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data/pgdata:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      PGDATA: /var/lib/postgresql/data/pgdata
      http_proxy: 
      https_proxy: 
      no_proxy:

Docker-compose v 14 :

postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      http_proxy:
      https_proxy:
      no_proxy:

Putting the old entries back, appears to fix it....I will try again in my VAL environment.....for those having the issues, ensure you put back the old entries from released v13 and rerun the installer. Will report back shortly with my VAL results.

@linuxcube
Copy link
Author

It seems that in the docker-compose generated by the V14 installer, the env variable PGDATA for the postgres container is missing.

Docker-compose v 13 :

  postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data/pgdata:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      PGDATA: /var/lib/postgresql/data/pgdata
      http_proxy: 
      https_proxy: 
      no_proxy:

Docker-compose v 14 :

postgres:
    image: postgres:10
    container_name: awx_postgres
    restart: unless-stopped
    volumes:
      - /var/lib/pgdocker/10/data/:/var/lib/postgresql/data:Z
    environment:
      POSTGRES_USER: awx
      POSTGRES_PASSWORD: awxpass
      POSTGRES_DB: awx
      http_proxy:
      https_proxy:
      no_proxy:

Team, I was able to fix this under my VAL environment...its working as expected....thank you all for the support.

@bile0026
Copy link

bile0026 commented Aug 10, 2020

Same issue here upgrading from 12.0.0 > 14.0.0. Postgres won't start.

cd into ~/.awx/awxcompose and running docker-compose down && docker-compose up -d did solve the issue though, so looks like I'm back in business.

@shanemcd
Copy link
Member

shanemcd commented Aug 10, 2020

Hi folks. Apologies for this, the breakage was not intentional. It does seem like this broke in 06fd131. Since fixing this would lead to more complications for future upgrades, I am inclined to roll forward and direct people towards the workarounds described above. Sorry again and thank you for living on the bleeding edge of a fast-moving project. 😄

@ghost
Copy link

ghost commented Sep 1, 2020

@shanemcd Why is this not specified in the upgrade documentation or at least the release notes?

If the upgrade is no longer seamless it needs to be mentioned somewhere that going from < v14 to v14 or higher requires additional manual intervention.

@ryanpetrello
Copy link
Contributor

@nvonwolf this isn't an issue we noticed until users reported it on upgrade (which is after we created the changelog/release notes)

Does this seem reasonable cc @shanemcd?

#8054

@ghost
Copy link

ghost commented Sep 1, 2020

Thanks for the quick response. Issue is solved for me after finding this thread but other may not be so lucky.

@danielbostock
Copy link

Same issue here upgrading from 12.0.0 > 14.0.0. Postgres won't start.

cd into ~/.awx/awxcompose and running docker-compose down && docker-compose up -d did solve the issue though, so looks like I'm back in business.

This also fixed my issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests