konga icon indicating copy to clipboard operation
konga copied to clipboard

Can't start konga with postgres 12-alpine

Open timpamungkas opened this issue 6 years ago • 20 comments

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)

timpamungkas avatar Nov 02 '19 20:11 timpamungkas

I can confirm this happens on PostgreSQL 12+ on macOS systems.

andrerfneves avatar Nov 06 '19 04:11 andrerfneves

Postgres 12+ is not supported by the underling pg driver.

pantsel avatar Nov 17 '19 09:11 pantsel

@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?

phlegx avatar Jul 02 '20 11:07 phlegx

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

phlegx avatar Sep 25 '20 11:09 phlegx

I used node ./bin/konga.js prepare --adapter postgres --uri postgresql://192.168.2.22:5432/konga,it always error: role "root" not exist! Then I crate the root in psql,the error: A hook (orm) failed to load! I just installed the PostgreSQL 12 ! Any news to support it?

lwx2615 avatar Dec 22 '20 11:12 lwx2615

Waiting for PostgreSQL 12 support 👍

edijsdrezovs avatar Feb 10 '21 00:02 edijsdrezovs

Any updates on that?

CesarNog avatar Sep 15 '21 18:09 CesarNog

Hi, any status about the issue?

aaaguirrep avatar Dec 29 '21 04:12 aaaguirrep

Hi, any status about the issue?

rhgs avatar Feb 06 '22 19:02 rhgs

Hi there, any update on this?

sha31dev avatar Aug 07 '22 10:08 sha31dev

Hi there, hope some update here

hail-pas avatar Sep 27 '22 07:09 hail-pas

Hi there, any update on this?

dark-code avatar Feb 23 '23 03:02 dark-code

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

mhagou avatar Feb 23 '23 19:02 mhagou

Is there a fix yet? Postgres RDS version :14.7 Konga version: 0.14.9

decipher27 avatar May 23 '23 12:05 decipher27

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 .

MArK1done avatar Jun 16 '23 09:06 MArK1done

This worked @MArK1done , thank you!

jhaprakash-nka avatar Aug 16 '23 14:08 jhaprakash-nka

Magic!!! 🪄

Thanks!

karan-nykaa avatar Aug 16 '23 14:08 karan-nykaa

A big thanks to you @MArK1done ! It was super helpful

ankurnykaa20 avatar Aug 16 '23 14:08 ankurnykaa20

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

mhagou avatar Oct 05 '23 15:10 mhagou

@mhagou do you have the link for your repo?

jhomarolo avatar Jan 15 '24 20:01 jhomarolo