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

complex k8s - server deployment throwing Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 } #15

Open
hkennyv opened this issue Oct 3, 2021 · 0 comments

Comments

@hkennyv
Copy link

hkennyv commented Oct 3, 2021

I ran into an issue with the server deployment as part of section 15 in the course. All of the other components were working correctly except the server deployment, which would throw (as shown in kubectl logs -f deployements/server-deployments):

khuynh@kmba:docker-and-kubernetes/complex-k8s ‹main*›$ kcl logs -f deployments/server-deployment
Found 6 pods, using pod/server-deployment-7bb8f4cf98-prk9d

> @ start /app
> node index.js

Listening
/app/node_modules/pg/lib/connection.js:441
  throw new Error('Unknown authenticationOk message type' + util.inspect(msg))
  ^

Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }
    at Connection.parseR (/app/node_modules/pg/lib/connection.js:441:9)
    at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:357:19)
    at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:119:22)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:639:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-03T22_06_17_783Z-debug.log

I think this could be related to the new version of PostgreSQL 14 on the latest tag?

khuynh@kmba:docker-and-kubernetes/complex-k8s ‹main*›$ kcl logs pod/postgres-deployment-fb4d66679-7wdrf
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.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2021-10-03 20:47:07.573 UTC [49] LOG:  starting PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-10-03 20:47:07.574 UTC [49] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-10-03 20:47:07.578 UTC [50] LOG:  database system was shut down at 2021-10-03 20:47:07 UTC
2021-10-03 20:47:07.580 UTC [49] LOG:  database system is ready to accept connections

The solution for me was to upgrade the version of pg in my package.json to "^8.7.1". I have an image w/ the updated pg client on dockerhub here: hkennyv/fib-server (anyone is welcome to use it).

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

No branches or pull requests

1 participant