Docker rebuild failed updating Postgresql: Signature verification failed


(Zachary Lewis) #1

I’m attempting to update my install. The admin panel informed me that I needed to update through SSH, and rebuild told me that I needed to migrate my database. Following the instructions, I updated my app.yaml file to point to templates/postgres.9.3.template.yml. Running launcher rebuild app again results in the following failure:

Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 10 app
app
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   2b8776d..7bde3d3  master     -> origin/master
Updating 2b8776d..7bde3d3
Fast-forward
 README.md          | 2 +-
 lib/pups/config.rb | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
I, [2016-09-27T21:19:44.510780 #17]  INFO -- : Loading --stdin
I, [2016-09-27T21:19:44.523709 #17]  INFO -- : > echo cron is now included in base image, remove from templates
I, [2016-09-27T21:19:44.527893 #17]  INFO -- : cron is now included in base image, remove from templates

I, [2016-09-27T21:19:44.529276 #17]  INFO -- : > apt-get remove -y postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
I, [2016-09-27T21:19:46.930960 #17]  INFO -- : Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 26.0 MB disk space will be freed.
(Reading database ... 34207 files and directories currently installed.)
Removing postgresql-contrib-9.5 (9.5.3-1.pgdg16.04+1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/9.5/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
Removing postgresql-9.5 (9.5.3-1.pgdg16.04+1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
Removing postgresql-client-9.5 (9.5.3-1.pgdg16.04+1) ...
Processing triggers for postgresql-common (174.pgdg16.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:

I, [2016-09-27T21:19:46.931767 #17]  INFO -- : > apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://deb.nodesource.com/node_4.x xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch https://deb.nodesource.com/node_4.x/dists/xenial/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/xenial-pgdg/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Some index files failed to download. They have been ignored, or old ones used instead.
E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-client-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 174.143.35.246 80]

E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 174.143.35.246 80]

E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-contrib-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 174.143.35.246 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I, [2016-09-27T21:19:50.443609 #17]  INFO -- : Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease [36.5 kB]
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Err:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:3 https://deb.nodesource.com/node_4.x xenial InRelease [3,914 B]
Err:3 https://deb.nodesource.com/node_4.x xenial InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Err:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Err:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Fetched 231 kB in 0s (373 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libossp-uuid16
Suggested packages:
  uuid locales-all postgresql-doc-9.3 libdbd-pg-perl
The following NEW packages will be installed:
  libossp-uuid16 postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,990 kB of archives.
After this operation, 23.9 MB of additional disk space will be used.
Err:1 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-client-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 174.143.35.246 80]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libossp-uuid16 amd64 1.6.2-1.5build2 [28.6 kB]
Err:3 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 174.143.35.246 80]
Err:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-contrib-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 174.143.35.246 80]
Fetched 28.6 kB in 0s (115 kB/s)



FAILED
--------------------
Pups::ExecError: apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 failed with return #<Process::Status: pid 171 exit 100>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3"
7ca18c151c47eb492259b85215913a2ff69bebde4a9cb81320b55a822bc76f41
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

How can I successfully update Discourse?


(Sam Saffron) #2

Something is wrong with our template we need to update it


(Sam Saffron) #3

I just tried on local and it is not failing for me… can you try

cd /var/discourse
git pull
./launcher rebuild app

(Zachary Lewis) #4

I’m still getting the same issue:

root@discourse:/var/discourse# git pull
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/discourse/discourse_docker
   0a27bab..c857317  master     -> origin/master
Updating 0a27bab..c857317
Fast-forward
 templates/cloudflare.template.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
root@discourse:/var/discourse# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   2b8776d..7bde3d3  master     -> origin/master
Updating 2b8776d..7bde3d3
Fast-forward
 README.md          | 2 +-
 lib/pups/config.rb | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
I, [2016-09-28T17:50:27.149277 #18]  INFO -- : Loading --stdin
I, [2016-09-28T17:50:27.158747 #18]  INFO -- : > echo cron is now included in base image, remove from templates
I, [2016-09-28T17:50:27.161672 #18]  INFO -- : cron is now included in base image, remove from templates

I, [2016-09-28T17:50:27.162174 #18]  INFO -- : > apt-get remove -y postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
I, [2016-09-28T17:50:29.865335 #18]  INFO -- : Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 26.0 MB disk space will be freed.
(Reading database ... 34207 files and directories currently installed.)
Removing postgresql-contrib-9.5 (9.5.3-1.pgdg16.04+1) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/9.5/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
Removing postgresql-9.5 (9.5.3-1.pgdg16.04+1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
Removing postgresql-client-9.5 (9.5.3-1.pgdg16.04+1) ...
Processing triggers for postgresql-common (174.pgdg16.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:

I, [2016-09-28T17:50:29.866077 #18]  INFO -- : > apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://deb.nodesource.com/node_4.x xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch https://deb.nodesource.com/node_4.x/dists/xenial/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/xenial-pgdg/InRelease  Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Some index files failed to download. They have been ignored, or old ones used instead.
E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-client-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 87.238.57.227 80]

E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 87.238.57.227 80]

E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-contrib-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 87.238.57.227 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I, [2016-09-28T17:50:35.248549 #18]  INFO -- : Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Get:3 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease [36.5 kB]
Get:4 https://deb.nodesource.com/node_4.x xenial InRelease [3,914 B]
Err:4 https://deb.nodesource.com/node_4.x xenial InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Err:3 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Get:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Err:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease
  Could not execute 'apt-key' to verify signature (is gnupg installed?)
Fetched 231 kB in 0s (385 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libossp-uuid16
Suggested packages:
  uuid locales-all postgresql-doc-9.3 libdbd-pg-perl
The following NEW packages will be installed:
  libossp-uuid16 postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,990 kB of archives.
After this operation, 23.9 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 libossp-uuid16 amd64 1.6.2-1.5build2 [28.6 kB]
Err:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-client-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 87.238.57.227 80]
Err:3 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 87.238.57.227 80]
Err:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-contrib-9.3 amd64 9.3.13-1.pgdg16.04+1
  404  Not Found [IP: 87.238.57.227 80]
Fetched 28.6 kB in 1s (18.0 kB/s)



FAILED
--------------------
Pups::ExecError: apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 failed with return #<Process::Status: pid 171 exit 100>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3"
5fb0ce5f48fdd96cb8a9ddec6d81b07a186666cf108874416685a669ab477a0c
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

The lines that are concerning me are the ones attempting to update postgresql, such as:

I, [2016-09-28T17:50:29.866077 #18]  INFO -- : > apt-get update && apt-get install -y postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)

And

E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-9.3/postgresql-9.3_9.3.13-1.pgdg16.04+1_amd64.deb  404  Not Found [IP: 87.238.57.227 80]

(Rafael dos Santos Silva) #5

Your apt update is failing, and then trying to download an older version that doesn’t exists anymore.

The main thing is: why did you changed from PostgreSQL 9.3 to 9.5? This won’t work!


(Sam Saffron) #6

Where is this installed? Are you behind some sort of proxy, do you have dns issues?


(Michael - DiscourseHosting.com) #7

which apparently causes a downgrade:

Sounds like the instructions are wrong or outdated. Just point it to postgres.9.5.template.yml ?


(Allen - Watchman Monitoring) #8

Here’s my story of how I got from Postgres 9.3 to 9.5

Maybe it’ll help here?


(Zachary Lewis) #9

@sam I’m on Digital Ocean.

@michaeld I made the change you suggested, and ./launcher rebuild app seems to be running fine.

This was the original message I received:

UPGRADE OF POSTGRES FAILED

You are going to need to export your data and import into a clean instance:

In containers/app.yml: Change "templates/postgres.template.yml" TO "templates/postgres.9.3.template.yml"

Run ./launcher rebuild app again

When your instance is running:
Run ./launcher enter app
Run cd /shared/postgres_backup && sudo -u postgres pg_dump discourse > backup.db

Undo the postgres template in your container config
Run: ./launcher stop app
Run: sudo mv /var/discourse/shared/standalone/postgres_data /var/discourse/shared/standalone/postgres_data_old
Run: ./launcher rebuild app

Run: ./launcher enter app
Run: cd /shared/postgres_backup
Run: sv stop unicorn
Run: sudo -iu postgres dropdb discourse
Run: sudo -iu postgres createdb discourse
Run: sudo -iu postgres psql discourse < backup.db
Run: exit
Run: ./launcher rebuild app

I’m planning on just following the rest of these directions, but with 9.3 changed to 9.5. Is this a good idea?


(Zachary Lewis) #10

And… nope. Now my discourse install is completely blank. I’ve got backups on S3, but I’m not sure how to get those backups into my install.

I’ll make a new topic to ask about restoring a backup from a previous version.


How to restore a backup of an older version to a fresh install?