pantsel / konga

More than just another GUI to Kong Admin API
MIT License
4.3k stars 825 forks source link

Can't start konga with postgres 12-alpine #487

Open timpamungkas opened 4 years ago

timpamungkas commented 4 years ago

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)
andrerfneves commented 4 years ago

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

pantsel commented 4 years ago

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

phlegx commented 4 years ago

@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 commented 3 years ago

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

lwx2615 commented 3 years ago

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?

edijsdrezovs commented 3 years ago

Waiting for PostgreSQL 12 support 👍

CesarNog commented 3 years ago

Any updates on that?

aaaguirrep commented 2 years ago

Hi, any status about the issue?

rhgs commented 2 years ago

Hi, any status about the issue?

sha31dev commented 2 years ago

Hi there, any update on this?

hail-pas commented 1 year ago

Hi there, hope some update here

dark-code commented 1 year ago

Hi there, any update on this?

mhagou commented 1 year ago

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

decipher27 commented 1 year ago

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

MArK1done commented 1 year ago

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 .

jhaprakash-nka commented 1 year ago

This worked @MArK1done , thank you!

karan-nykaa commented 1 year ago

Magic!!! 🪄

Thanks!

ankurnykaa20 commented 1 year ago

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

mhagou commented 11 months ago

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

jhomarolo commented 8 months ago

@mhagou do you have the link for your repo?