pantsel / konga

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

konga not works "error: A hook (`orm`) failed to load" #462

Closed xpoveda closed 5 years ago

xpoveda commented 5 years ago

Hi, somedays ago konga is installed perfect but now returns this error always (swarm and not swarm mode)

ubuntu@pre@:~/misproyectos/entorno-ci-herramientas/src/aws/kong(master)$ docker run -p 1337:1337 --network demo_net -e "DB_ADAPTER=postgres" -e "DB_HOST=postgresdemo" -e "DB_PORT=5432" -e "DB_USER=kong" -e "DB_PASSWORD=kong" -e "DB_DATABASE=kong" --name konga pantsel/konga
Using postgres DB Adapter.
Database exists. Continue...
error: A hook (`orm`) failed to load!
error: error: column r.consrc does not exist
    at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
    at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
    at Socket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:601:20)
/app/node_modules/sails-postgresql/lib/adapter.js:158
        var collection = connectionObject.collections[table];
                                          ^

TypeError: Cannot read property 'collections' of undefined
    at __DESCRIBE__ (/app/node_modules/sails-postgresql/lib/adapter.js:158:43)
    at after (/app/node_modules/sails-postgresql/lib/adapter.js:1292:7)
    at /app/node_modules/sails-postgresql/lib/adapter.js:1181:7
    at /app/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:84:11
    at dispense (/app/node_modules/sails-postgresql/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:250:16)
    at Object.me.release (/app/node_modules/sails-postgresql/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:349:5)
    at /app/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:88:20
    at /app/node_modules/sails-postgresql/lib/adapter.js:1295:9
    at Query.callback (/app/node_modules/sails-postgresql/lib/adapter.js:195:26)
    at Query.handleError (/app/node_modules/sails-postgresql/node_modules/pg/lib/query.js:106:17)
    at Connection.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/client.js:171:26)
    at emitOne (events.js:116:13)
    at Connection.emit (events.js:211:7)
    at Socket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:109:12)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:601:20)

Thanks so much in advance.

Kind regards!!

Xavier.

xpoveda commented 5 years ago

Hi everybody,

I have added the KONGA_HOOK_TIMEOUT environment variable but not works...;__(


services:

  konga:
    image: pantsel/konga
    networks:
      - demo_net
    ports:
      - 80:1337
    environment:
      - DB_ADAPTER=postgres
      - DB_HOST=postgresdemo
      - DB_USER=kong
      - DB_PASSWORD=kong
      - DB_DATABASE=kong
      - NODE_ENV=development
      - KONGA_HOOK_TIMEOUT=120000
    deploy:
      replicas: 1

networks:
  demo_net:
    external: true
xpoveda commented 5 years ago

Issue solved, the problem was with the version of postgres.

Working with containers with postgres:alpine don't work, with postgres:9.6 konga works perfectly.

Thanks so much!!

Xavier.

lukasa1993 commented 4 years ago

i am having this issue with postgres 12 its simply not supported?

xpoveda commented 4 years ago

Hi,when I have this issue simply is this, with postgres 9.6 works perfect.

Xavier.

El dom., 24 may. 2020 12:11, luka dodelia notifications@github.com escribió:

i am having this issue with postgres 12 its simply not supported?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pantsel/konga/issues/462#issuecomment-633208292, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADF4XF2B2OFOXWIJYS7DYYLRTDXDHANCNFSM4I6EVVCA .

lukasa1993 commented 4 years ago

i really need this to work on postgres12 :( @pantsel any idea how i can make it ?

pantsel commented 4 years ago

@lukasa1993 , unfortunatelly pg 12 is not supported by the underlying driver. It all comes down to the sails framework used by Konga. An update to the most recent version requires a whole rewrite of the project. On the upside, a second generation of Konga is in the works but it will take some time for it to be publicly available.

If you have no alternatives, I would suggest that you use the build-in filesystem db, provided that you can mount a volume to konga-data folder. I've done it with no problems on production environments.

lukasa1993 commented 4 years ago

filesystem-db works in production mode ? and what would be docker mount point for it ?

pantsel commented 4 years ago

If I understand you question correctly it would be something in the line of /host/path:/konga-data

lukasa1993 commented 4 years ago

so it works in production mode… what is latest version of postgres that it works ?

pantsel commented 4 years ago

Yes, it works in production. I think 9.6, the adapter is quite old.

lukasa1993 commented 4 years ago

/app/kongadata isn't this path for docker container ? /konga-data is empty…

pantsel commented 4 years ago

Yup, sorry.

lukasa1993 commented 4 years ago

ty, looking forward new konga hit me up for testing when its ready

pantsel commented 4 years ago

Ofcourse, there will also be an announcement on gitter

Carmezim commented 4 years ago

Could be helpful adding a note regarding Postgres 12+ incompatibility to the docs, thanks for the clarification though.

ttpro1995 commented 3 years ago

confirm Postgres 13 also have this error

sudo docker run --rm pantsel/konga:latest -c prepare -a postgres -u postgresql://konga:meowmeowmeow@my_ip:5432/konga
debug: Preparing database...
Using postgres DB Adapter.
Database exists. Continue...
error: A hook (`orm`) failed to load!
error: Failed to prepare database: error: column r.consrc does not exist
    at Connection.parseE (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
    at Connection.parseMessage (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
    at Socket.<anonymous> (/app/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105:22)
    at Socket.emit (events.js:310:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at addChunk (_stream_readable.js:286:12)
    at readableAddChunk (_stream_readable.js:268:9)
    at Socket.Readable.push (_stream_readable.js:209:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
sudhanshud commented 3 years ago

I am facing the same issue when using mongo Atlas. Any idea?

RagunathInGIT commented 3 years ago

@pantsel - Do we have the latest version of Konga that connects to postgres 12 or later?

tianqing108 commented 3 years ago

@pantsel this issue was happened one years age,why don't you fix it? up you lib ,it may be works

bangdoni commented 2 years ago

I tried on Postgresql 9.6 -> link and .env file

PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres
DB_URI=postgresql://dbuser:dbpassword@localhost:5432/kongadb
DB_USER=dbuser
DB_PORT=5432
DB_DATABASE=kongadb
DB_PASSWORD=dbpassword
KONGA_LOG_LEVEL=warn
TOKEN_SECRET=your-token
lpj145 commented 2 years ago

https://github.com/balderdashy/sails/issues/6957 issue is with sailsjs and the solution to @pantsel are here: https://github.com/balderdashy/sails/issues/6957#issuecomment-591954307

isaac88 commented 2 years ago

For those that they have the possibility to use MySQL, I've tested with the latest"current" version 8.0.29 and it works fine.

gharia commented 2 years ago

@lukasa1993 , unfortunatelly pg 12 is not supported by the underlying driver. It all comes down to the sails framework used by Konga. An update to the most recent version requires a whole rewrite of the project. On the upside, a second generation of Konga is in the works but it will take some time for it to be publicly available.

If you have no alternatives, I would suggest that you use the build-in filesystem db, provided that you can mount a volume to konga-data folder. I've done it with no problems on production environments.

@pantsel, any update of supporting the latest postgres or any plan in the near future?

gbl-michell commented 1 year ago

:eyes:

salao-na-mao-developer commented 1 year ago

I am facing the same issue when using mongo Atlas. Any idea?

Same here :/

sudhanshud commented 1 year ago

Hi,

R u using normal connection string or mongo srv connection string?

Thanks, Sudhanshu Dev

On Thu, Dec 1, 2022 at 5:07 AM Salão Na Mão Engenharia < @.***> wrote:

I am facing the same issue when using mongo Atlas. Any idea?

Same here :/

— Reply to this email directly, view it on GitHub https://github.com/pantsel/konga/issues/462#issuecomment-1332892563, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPO62RLPVCRKWOPHX25HKLWK7QJZANCNFSM4I6EVVCA . You are receiving this because you commented.Message ID: @.***>

mhagou commented 1 year ago

Hi,

take a look on this https://github.com/pantsel/konga/issues/487.

I describe a solution for postgres 14.

Regards.