konga: Can't start konga with postgres 12-alpine

Hi, I’m trying to start konga with postgres 12 (docker-based) as database. However, it cannot started. The docker logs show this error

Postgres 11 works fine

 debug: Preparing database...
konga-prepare     | Using postgres DB Adapter.
konga-prepare     | Database exists. Continue...
konga-prepare     | error: A hook (`orm`) failed to load!
konga-prepare     | error: Failed to prepare database: error: column r.consrc does not exist
konga-prepare     |     at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
konga-prepare     |     at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
konga-prepare     |     at Socket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
konga-prepare     |     at Socket.emit (events.js:198:13)
konga-prepare     |     at Socket.EventEmitter.emit (domain.js:448:20)
konga-prepare     |     at addChunk (_stream_readable.js:288:12)
konga-prepare     |     at readableAddChunk (_stream_readable.js:269:11)
konga-prepare     |     at Socket.Readable.push (_stream_readable.js:224:10)
konga-prepare     |     at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 14
  • Comments: 20 (1 by maintainers)

Most upvoted comments

Waiting for PostgreSQL 12 support 👍

@pantsel Is this still the case or is it supported in the meanwhile?

Getting the same error as @timpamungkas, so I assume, that it is probably the case. Are there plans to support postgres 12 at some point?

@pantsel Hi there! It’s me again. Can we support higher Postgres versions as well?

Hi,

The following is my resolution to make Konga v14.9 work with Postgres v14.6 after migrating from Postgres v11.

Konga has not been maintained for more than two years, and the last supported version of Postgres is version v11. Currently, we are on version 15, but I haven’t tested it on this version. What follows only addresses my need on version 14.

When using the latest version of the Konga image on version 14, an authentication error is received because of change in encryption as described by @diegonc in #747

Error: Unknown authenticationOk message typeMessage { name: ‘authenticationOk’, length: 23 } at Connection.parseR (/root/konga/node_modules/pg/lib/connection.js:426:9) at Connection.parseMessage (/root/konga/node_modules/pg/lib/connection.js:345:17) at Socket. (/root/konga/node_modules/pg/lib/connection.js:105:22) … …

This is because of SCRAM-SHA-256 passwords in Postgres 14, so you need to downgrade the password encryption to md5 as explained Postgres Docs.

Please note that this change requires a restart of the database and the resetting of existing user passwords to encrypt them in md5.

Luckily for me, there were only two users, Konga and Postgres.

After modifying the database, when starting Konga, another error related to the Postgres catalog is received as described #487 and #462 :

konga-prepare | error: Failed to prepare database: error: column r.consrc does not exist konga-prepare | at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11) … …

So, I started the image locally with:

docker run -it --entrypoint /bin/bash pantsel/konga

I modified the two files : /app/config/connections.js /app/node_modules/sails-postgresql/lib/adapter.js as described here by @RodrigoRodriguesX10 in balderdashy/sails#6957

In my case, I also need to reduce the size of the pool (poolSize: process.env.DB_POOLSIZE by default at 10, I set it to 5) to workaround a limited configuration in db side.

Then I commited the container to image and pushed it to the Docker registry:

docker commit to modified_image > docker build with dockerfile below + docker tag > docker push.

FROM modified/konga WORKDIR /app EXPOSE 1337 VOLUME /app/kongadata ENTRYPOINT [“/app/start.sh”]

The image runs perfectly and it is on Docker Hub, here

docker pull moago/konga_pg14:0.15

hope this help. Regards

This helped me massively. Thank you very much @mhagou .

Hi, any status about the issue?

Hi, any status about the issue?

Any updates on that?

Hi, The following is my resolution to make Konga v14.9 work with Postgres v14.6 after migrating from Postgres v11. Konga has not been maintained for more than two years, and the last supported version of Postgres is version v11. Currently, we are on version 15, but I haven’t tested it on this version. What follows only addresses my need on version 14. When using the latest version of the Konga image on version 14, an authentication error is received because of change in encryption as described by @diegonc in #747

Error: Unknown authenticationOk message typeMessage { name: ‘authenticationOk’, length: 23 } at Connection.parseR (/root/konga/node_modules/pg/lib/connection.js:426:9) at Connection.parseMessage (/root/konga/node_modules/pg/lib/connection.js:345:17) at Socket. (/root/konga/node_modules/pg/lib/connection.js:105:22) … …

This is because of SCRAM-SHA-256 passwords in Postgres 14, so you need to downgrade the password encryption to md5 as explained Postgres Docs. Please note that this change requires a restart of the database and the resetting of existing user passwords to encrypt them in md5. Luckily for me, there were only two users, Konga and Postgres. After modifying the database, when starting Konga, another error related to the Postgres catalog is received as described #487 and #462 :

konga-prepare | error: Failed to prepare database: error: column r.consrc does not exist konga-prepare | at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11) … …

So, I started the image locally with:

docker run -it --entrypoint /bin/bash pantsel/konga

I modified the two files : /app/config/connections.js /app/node_modules/sails-postgresql/lib/adapter.js as described here by @RodrigoRodriguesX10 in balderdashy/sails#6957 In my case, I also need to reduce the size of the pool (poolSize: process.env.DB_POOLSIZE by default at 10, I set it to 5) to workaround a limited configuration in db side. Then I commited the container to image and pushed it to the Docker registry: docker commit to modified_image > docker build with dockerfile below + docker tag > docker push.

FROM modified/konga WORKDIR /app EXPOSE 1337 VOLUME /app/kongadata ENTRYPOINT [“/app/start.sh”]

The image runs perfectly and it is on Docker Hub, here

docker pull moago/konga_pg14:0.15

hope this help. Regards

This helped me massively. Thank you very much @mhagou .

Glad to see it helped you 😃 and all other folks

Hi,

The following is my resolution to make Konga v14.9 work with Postgres v14.6 after migrating from Postgres v11.

Konga has not been maintained for more than two years, and the last supported version of Postgres is version v11. Currently, we are on version 15, but I haven’t tested it on this version. What follows only addresses my need on version 14.

When using the latest version of the Konga image on version 14, an authentication error is received because of change in encryption as described by @diegonc in https://github.com/pantsel/konga/issues/747

Error: Unknown authenticationOk message typeMessage { name: ‘authenticationOk’, length: 23 } at Connection.parseR (/root/konga/node_modules/pg/lib/connection.js:426:9) at Connection.parseMessage (/root/konga/node_modules/pg/lib/connection.js:345:17) at Socket. (/root/konga/node_modules/pg/lib/connection.js:105:22) … …

This is because of SCRAM-SHA-256 passwords in Postgres 14, so you need to downgrade the password encryption to md5 as explained Postgres Docs.

Please note that this change requires a restart of the database and the resetting of existing user passwords to encrypt them in md5.

Luckily for me, there were only two users, Konga and Postgres.

After modifying the database, when starting Konga, another error related to the Postgres catalog is received as described https://github.com/pantsel/konga/issues/487 and https://github.com/pantsel/konga/issues/462 :

konga-prepare | error: Failed to prepare database: error: column r.consrc does not exist konga-prepare | at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11) … …

So, I started the image locally with:

docker run -it --entrypoint /bin/bash pantsel/konga

I modified the two files : /app/config/connections.js /app/node_modules/sails-postgresql/lib/adapter.js as described here by @RodrigoRodriguesX10 in https://github.com/balderdashy/sails/issues/6957

In my case, I also need to reduce the size of the pool (poolSize: process.env.DB_POOLSIZE by default at 10, I set it to 5) to workaround a limited configuration in db side.

Then I commited the container to image and pushed it to the Docker registry:

docker commit to modified_image > docker build with dockerfile below + docker tag > docker push.

FROM modified/konga WORKDIR /app EXPOSE 1337 VOLUME /app/kongadata ENTRYPOINT [“/app/start.sh”]

The image runs perfectly and it is on Docker Hub, here

docker pull moago/konga_pg14:0.15

hope this help. Regards