Sitelet https://github.com/dbgate/dbgate/issues/1538
Skip to content

BUG: Web app hangs on first session #1538

Description

@ezwelty

Describe the bug
After the web app process is started, the first attempt to load the web app fails: it hangs on "waiting for structure". Reloading the page fixes the problem.

To Reproduce
Steps to reproduce the behavior:

  1. Start the web app on the server
  2. Open the web app in a browser
  3. Reload the page

Expected behavior
The web app loads when first started.

Version Information (please complete the following information):

  • OS: Ubuntu
  • App Version: 7.2.1
  • Install source: NPM
  • Type: Web
  • Database engine: PostgreSQL

Logs

{"pid":531385,"caller":"connections","name":"databaseConnection","connections":[{"_id":"***","engine":"postgres@dbgate-plugin-postgres","server":"***","user":"***","password":"***","port":"5432","useDatabaseUrl":false,"defaultDatabase":"***","singleDatabase":true,"displayName":"***","isReadOnly":"***","databases":null,"useSeparateSchemas":false}],"level":30,"msg":"DBGM-00005 Using connections from ENV variables","time":1786612083302}
{"pid":531385,"caller":"requirePlugin","name":"databaseConnection","level":30,"msg":"DBGM-00062 Loading module dbgate-plugin-postgres from /home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-plugin-postgres/dist/backend.js","time":1786612083418}
{"pid":531385,"caller":"dbconnProcess","name":"databaseConnection","database":"wgms","conid":"postgres","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00038 Connected to database, separate schemas: NO","time":1786612083461}
{"pid":531385,"caller":"dbconnProcess","name":"databaseConnection","database":"wgms","conid":"postgres","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00037 Got server version: PostgreSQL 17.10 (Ubuntu 17.10-1.pgdg26.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit","time":1786612083463}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":0,"analyseIdentifier":"39336300837354754","level":20,"msg":"DBGM-00126 Performing full analysis","time":1786612083463}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":1,"analyseIdentifier":"39336300837354754","level":20,"msg":"DBGM-00241 Loading database structure","time":1786612083464}
{"pid":531370,"level":50,"msg":"(node:531385) DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.","time":1786612083466}
{"pid":531370,"level":50,"msg":"(Use `node --trace-deprecation ...` to show where the warning was created)","time":1786612083466}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":21,"analyseIdentifier":"39336300837354754","rows":59,"template":"tableList","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083484}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":40,"analyseIdentifier":"39336300837354754","rows":17,"template":"views","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083503}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":52,"analyseIdentifier":"39336300837354754","rows":596,"template":"columns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083515}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":55,"analyseIdentifier":"39336300837354754","rows":65,"template":"primaryKeys","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083518}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":69,"analyseIdentifier":"39336300837354754","rows":95,"template":"foreignKeys","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083532}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":70,"analyseIdentifier":"39336300837354754","rows":24,"template":"uniqueNames","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083533}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":81,"analyseIdentifier":"39336300837354754","rows":691,"template":"routines","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083544}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":93,"analyseIdentifier":"39336300837354754","rows":930,"template":"proceduresParameters","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083556}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":95,"analyseIdentifier":"39336300837354754","rows":39,"template":"indexes","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083558}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":97,"analyseIdentifier":"39336300837354754","rows":58,"template":"indexcols","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083560}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":100,"analyseIdentifier":"39336300837354754","rows":1,"template":"matviews","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083563}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":101,"analyseIdentifier":"39336300837354754","rows":4,"template":"matviewColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083564}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":104,"analyseIdentifier":"39336300837354754","rows":25,"template":"triggers","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083567}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":112,"analyseIdentifier":"39336300837354754","rows":13,"template":"geometryColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083575}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":114,"analyseIdentifier":"39336300837354754","rows":0,"template":"geographyColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612083577}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":115,"analyseIdentifier":"39336300837354754","level":20,"msg":"DBGM-00258 Finalizing DB structure","time":1786612083578}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":129,"analyseIdentifier":"39336300837354754","tables":59,"columns":472,"primaryKeys":51,"foreignKeys":93,"indexes":15,"uniques":24,"views":17,"matviews":1,"procedures":0,"functions":691,"level":20,"msg":"DBGM-00141 Database structured finalized","time":1786612083592}
{"pid":531385,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":129,"analyseIdentifier":"39336300837354754","level":20,"msg":"DBGM-00271 Full analysis finished successfully","time":1786612083592}
{"pid":531370,"caller":"checkLicense","errorMessage":"jwt malformed","errorObject":{"name":"JsonWebTokenError","message":"jwt malformed"},"errorStack":"JsonWebTokenError: jwt malformed\n    at module.exports [as verify] (/home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/jsonwebtoken/verify.js:63:17)\n    at checkLicenseKey (/home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-api-premium/src/utility/checkLicense.js:132:25)\n    at checkLicense (/home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-api-premium/src/utility/checkLicense.js:253:12)\n    at Object.get (/home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-api-premium/src/controllers/config.js:71:66)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async /home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-api-premium/src/utility/useController.js:78:24","level":50,"msg":"DBGM-00162 License token is invalid","time":1786612085486}
^C{"pid":531370,"caller":"main","level":30,"msg":"DBGM-00034 Shutting down DbGate API server","time":1786612095329}
{"pid":531370,"caller":"main","level":30,"msg":"DBGM-00036 Server close timeout, terminating","time":1786612096331}
(dbgate) ewelty@sc40:/project-data$ nano .env
(dbgate) ewelty@sc40:/project-data$ dbgate-serve-premium
{"pid":531518,"caller":"connections","connections":[{"_id":"***","engine":"postgres@dbgate-plugin-postgres","server":"***","user":"***","password":"***","port":"5432","useDatabaseUrl":false,"defaultDatabase":"***","singleDatabase":true,"displayName":"***","isReadOnly":"***","databases":null,"useSeparateSchemas":false}],"level":30,"msg":"DBGM-00005 Using connections from ENV variables","time":1786612194963}
{"pid":531518,"caller":"useController","level":30,"msg":"DBGM-00096 Calling init controller for controller /connections","time":1786612195186}
{"pid":531518,"caller":"useController","level":30,"msg":"DBGM-00096 Calling init controller for controller /database-connections","time":1786612195187}
{"pid":531518,"caller":"useController","level":30,"msg":"DBGM-00096 Calling init controller for controller /storage","time":1786612195188}
{"pid":531518,"caller":"useController","level":30,"msg":"DBGM-00096 Calling init controller for controller /scheduler","time":1786612195189}
{"pid":531518,"caller":"directories","level":30,"msg":"DBGM-00170 Cleaning directory /home/ewelty/.dbgate/run","time":1786612195190}
{"pid":531518,"caller":"main","level":30,"msg":"DBGM-00031 DbGate API listening on port 3000 (NPM build)","time":1786612195197}
{"pid":531535,"caller":"connections","name":"databaseConnection","connections":[{"_id":"***","engine":"postgres@dbgate-plugin-postgres","server":"***","user":"***","password":"***","port":"5432","useDatabaseUrl":false,"defaultDatabase":"***","singleDatabase":true,"displayName":"***","isReadOnly":"***","databases":null,"useSeparateSchemas":false}],"level":30,"msg":"DBGM-00005 Using connections from ENV variables","time":1786612204023}
{"pid":531535,"caller":"requirePlugin","name":"databaseConnection","level":30,"msg":"DBGM-00062 Loading module dbgate-plugin-postgres from /home/ewelty/.conda/envs/dbgate/lib/node_modules/dbgate-serve-premium/node_modules/dbgate-plugin-postgres/dist/backend.js","time":1786612204142}
{"pid":531535,"caller":"dbconnProcess","name":"databaseConnection","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00039 Loading schema list","time":1786612204157}
{"pid":531535,"caller":"dbconnProcess","name":"databaseConnection","database":"wgms","conid":"postgres","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00038 Connected to database, separate schemas: NO","time":1786612204190}
{"pid":531535,"caller":"dbconnProcess","name":"databaseConnection","database":"wgms","conid":"postgres","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00037 Got server version: PostgreSQL 17.10 (Ubuntu 17.10-1.pgdg26.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit","time":1786612204192}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":0,"analyseIdentifier":"7351816677496281","level":20,"msg":"DBGM-00126 Performing full analysis","time":1786612204192}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":1,"analyseIdentifier":"7351816677496281","level":20,"msg":"DBGM-00241 Loading database structure","time":1786612204193}
{"pid":531518,"level":50,"msg":"(node:531535) DeprecationWarning: Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.","time":1786612204195}
{"pid":531518,"level":50,"msg":"(Use `node --trace-deprecation ...` to show where the warning was created)","time":1786612204196}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":22,"analyseIdentifier":"7351816677496281","rows":59,"template":"tableList","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204214}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":40,"analyseIdentifier":"7351816677496281","rows":17,"template":"views","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204232}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":53,"analyseIdentifier":"7351816677496281","rows":596,"template":"columns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204245}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":56,"analyseIdentifier":"7351816677496281","rows":65,"template":"primaryKeys","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204248}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":67,"analyseIdentifier":"7351816677496281","rows":95,"template":"foreignKeys","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204259}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":67,"analyseIdentifier":"7351816677496281","rows":24,"template":"uniqueNames","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204259}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":77,"analyseIdentifier":"7351816677496281","rows":691,"template":"routines","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204269}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":85,"analyseIdentifier":"7351816677496281","rows":930,"template":"proceduresParameters","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204277}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":86,"analyseIdentifier":"7351816677496281","rows":39,"template":"indexes","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204278}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":88,"analyseIdentifier":"7351816677496281","rows":58,"template":"indexcols","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204280}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":89,"analyseIdentifier":"7351816677496281","rows":1,"template":"matviews","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204281}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":90,"analyseIdentifier":"7351816677496281","rows":4,"template":"matviewColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204282}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":91,"analyseIdentifier":"7351816677496281","rows":25,"template":"triggers","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204283}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":97,"analyseIdentifier":"7351816677496281","rows":13,"template":"geometryColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204289}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":99,"analyseIdentifier":"7351816677496281","rows":0,"template":"geographyColumns","level":20,"msg":"DBGM-00129 Loaded analyser query","time":1786612204291}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":99,"analyseIdentifier":"7351816677496281","level":20,"msg":"DBGM-00258 Finalizing DB structure","time":1786612204291}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":111,"analyseIdentifier":"7351816677496281","tables":59,"columns":472,"primaryKeys":51,"foreignKeys":93,"indexes":15,"uniques":24,"views":17,"matviews":1,"procedures":0,"functions":691,"level":20,"msg":"DBGM-00141 Database structured finalized","time":1786612204303}
{"pid":531535,"caller":"dbAnalyser","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","analyserTime":111,"analyseIdentifier":"7351816677496281","level":20,"msg":"DBGM-00271 Full analysis finished successfully","time":1786612204303}
{"pid":531535,"caller":"postreDriver","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","level":20,"msg":"DBGM-00142 Loaded 10 postgres schemas","time":1786612204310}

App is stuck at "Waiting for structure".
Reload page.

{"pid":531535,"caller":"dbconnProcess","name":"databaseConnection","database":"wgms","conid":"postgres","engine":"postgres@dbgate-plugin-postgres","level":20,"msg":"DBGM-00039 Loading schema list","time":1786612359440}
{"pid":531535,"caller":"postreDriver","name":"databaseConnection","database":"wgms","engine":"postgres@dbgate-plugin-postgres","conid":"postgres","level":20,"msg":"DBGM-00142 Loaded 10 postgres schemas","time":1786612359448}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions