transistorsoft / background-geolocation-console

A field-testing & analysis server for the Background Geolocation plugin
MIT License
151 stars 157 forks source link

Getting an error while trying to connect the app with the server #100

Closed sparkmobi closed 4 years ago

sparkmobi commented 4 years ago

Hello,

i am getting this error in the server log(heroku)

`2020-01-29T21:25:50.174892+00:00 app[web.1]:      dataType: undefined,
2020-01-29T21:25:50.174894+00:00 app[web.1]:      constraint: undefined,
2020-01-29T21:25:50.174896+00:00 app[web.1]:      file: 'parse_relation.c',
2020-01-29T21:25:50.174898+00:00 app[web.1]:      line: '1180',
2020-01-29T21:25:50.174900+00:00 app[web.1]:      routine: 'parserOpenTable',
2020-01-29T21:25:50.174902+00:00 app[web.1]:      sql: 'SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = \'asdasd\' LIMIT 1;',
2020-01-29T21:25:50.174904+00:00 app[web.1]:      parameters: undefined },
2020-01-29T21:25:50.174906+00:00 app[web.1]:   sql: 'SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = \'asdasd\' LIMIT 1;',
2020-01-29T21:25:50.174908+00:00 app[web.1]:   parameters: undefined }
2020-01-29T21:25:50.177059+00:00 app[web.1]: ::ffff:10.7.161.186 - POST /api/register HTTP/1.1 500 35 - 18.271 ms
2020-01-29T21:25:51.135227+00:00 app[web.1]: ::ffff:10.30.238.92 - POST /api/locations HTTP/1.1 406 - - 0.579 ms
2020-01-29T21:25:51.135810+00:00 heroku[router]: at=info method=POST path="/api/locations" host=familytracker11.herokuapp.com request_id=b97f9e67-278f-48f2-b6db-929bf06264a6 fwd="41.234.215.80" dyno=web.1 connect=0ms service=5ms status=406 bytes=143 protocol=https
2020-01-29T21:25:51.405822+00:00 heroku[router]: at=info method=POST path="/api/register" host=familytracker11.herokuapp.com request_id=960d3f37-5e1e-4c17-b0c7-d8cfd0770a4d fwd="41.234.215.80" dyno=web.1 connect=0ms service=21ms status=500 bytes=235 protocol=https
2020-01-29T21:25:51.387943+00:00 app[web.1]: POST /register  org asdasd uuid Android SDK built for x86-asdasd model Android SDK built for x86 version 10 framework flutter
2020-01-29T21:25:51.391992+00:00 app[web.1]: Executing (5262f0bd-9dd1-4eb8-975a-013a91e6b103): START TRANSACTION;
2020-01-29T21:25:51.397697+00:00 app[web.1]: Executing (5262f0bd-9dd1-4eb8-975a-013a91e6b103): SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = 'asdasd' LIMIT 1;
2020-01-29T21:25:51.401900+00:00 app[web.1]: Executing (5262f0bd-9dd1-4eb8-975a-013a91e6b103): COMMIT;
2020-01-29T21:25:51.403984+00:00 app[web.1]: /register { SequelizeDatabaseError: relation "companies" does not exist
2020-01-29T21:25:51.403988+00:00 app[web.1]:     at Query.formatError (/app/node_modules/sequelize/lib/dialects/postgres/query.js:366:16)
2020-01-29T21:25:51.403990+00:00 app[web.1]:     at query.catch.err (/app/node_modules/sequelize/lib/dialects/postgres/query.js:72:18)
2020-01-29T21:25:51.403992+00:00 app[web.1]:     at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2020-01-29T21:25:51.403994+00:00 app[web.1]:     at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:547:31)
2020-01-29T21:25:51.403996+00:00 app[web.1]:     at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:604:18)
2020-01-29T21:25:51.403998+00:00 app[web.1]:     at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:649:10)
2020-01-29T21:25:51.404000+00:00 app[web.1]:     at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:725:18)
2020-01-29T21:25:51.404002+00:00 app[web.1]:     at _drainQueueStep (/app/node_modules/bluebird/js/release/async.js:93:12)
2020-01-29T21:25:51.404004+00:00 app[web.1]:     at _drainQueue (/app/node_modules/bluebird/js/release/async.js:86:9)
2020-01-29T21:25:51.404006+00:00 app[web.1]:     at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:102:5)
2020-01-29T21:25:51.404008+00:00 app[web.1]:     at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:15:14)
2020-01-29T21:25:51.404011+00:00 app[web.1]:     at runCallback (timers.js:810:20)
2020-01-29T21:25:51.404013+00:00 app[web.1]:     at tryOnImmediate (timers.js:768:5)
2020-01-29T21:25:51.404015+00:00 app[web.1]:     at processImmediate [as _immediateCallback] (timers.js:745:5)
2020-01-29T21:25:51.404018+00:00 app[web.1]:   name: 'SequelizeDatabaseError',
2020-01-29T21:25:51.404020+00:00 app[web.1]:   parent: 
2020-01-29T21:25:51.404022+00:00 app[web.1]:    { error: relation "companies" does not exist
2020-01-29T21:25:51.404024+00:00 app[web.1]:     at Connection.parseE (/app/node_modules/pg/lib/connection.js:554:11)
2020-01-29T21:25:51.404026+00:00 app[web.1]:     at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:381:17)
2020-01-29T21:25:51.404089+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:117:22)
2020-01-29T21:25:51.404093+00:00 app[web.1]:     at emitOne (events.js:116:13)
2020-01-29T21:25:51.404095+00:00 app[web.1]:     at Socket.emit (events.js:211:7)
2020-01-29T21:25:51.404097+00:00 app[web.1]:     at addChunk (_stream_readable.js:263:12)
2020-01-29T21:25:51.404099+00:00 app[web.1]:     at readableAddChunk (_stream_readable.js:250:11)
2020-01-29T21:25:51.404101+00:00 app[web.1]:     at Socket.Readable.push (_stream_readable.js:208:10)
2020-01-29T21:25:51.404103+00:00 app[web.1]:     at TCP.onread (net.js:601:20)
2020-01-29T21:25:51.404105+00:00 app[web.1]:      name: 'error',
2020-01-29T21:25:51.404107+00:00 app[web.1]:      length: 108,
2020-01-29T21:25:51.404119+00:00 app[web.1]:      severity: 'ERROR',
2020-01-29T21:25:51.404121+00:00 app[web.1]:      code: '42P01',
2020-01-29T21:25:51.404123+00:00 app[web.1]:      detail: undefined,
2020-01-29T21:25:51.404125+00:00 app[web.1]:      hint: undefined,
2020-01-29T21:25:51.404127+00:00 app[web.1]:      position: '63',
2020-01-29T21:25:51.404129+00:00 app[web.1]:      internalPosition: undefined,
2020-01-29T21:25:51.404131+00:00 app[web.1]:      internalQuery: undefined,
2020-01-29T21:25:51.404133+00:00 app[web.1]:      where: undefined,
2020-01-29T21:25:51.404135+00:00 app[web.1]:      schema: undefined,
2020-01-29T21:25:51.404137+00:00 app[web.1]:      table: undefined,
2020-01-29T21:25:51.404138+00:00 app[web.1]:      column: undefined,
2020-01-29T21:25:51.404140+00:00 app[web.1]:      dataType: undefined,
2020-01-29T21:25:51.404142+00:00 app[web.1]:      constraint: undefined,
2020-01-29T21:25:51.404144+00:00 app[web.1]:      file: 'parse_relation.c',
2020-01-29T21:25:51.404146+00:00 app[web.1]:      line: '1180',
2020-01-29T21:25:51.404149+00:00 app[web.1]:      routine: 'parserOpenTable',
2020-01-29T21:25:51.404151+00:00 app[web.1]:      sql: 'SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = \'asdasd\' LIMIT 1;',
2020-01-29T21:25:51.404153+00:00 app[web.1]:      parameters: undefined },
2020-01-29T21:25:51.404155+00:00 app[web.1]:   original: 
2020-01-29T21:25:51.404158+00:00 app[web.1]:    { error: relation "companies" does not exist
2020-01-29T21:25:51.404160+00:00 app[web.1]:     at Connection.parseE (/app/node_modules/pg/lib/connection.js:554:11)
2020-01-29T21:25:51.404162+00:00 app[web.1]:     at Connection.parseMessage (/app/node_modules/pg/lib/connection.js:381:17)
2020-01-29T21:25:51.404164+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:117:22)
2020-01-29T21:25:51.404166+00:00 app[web.1]:     at emitOne (events.js:116:13)
2020-01-29T21:25:51.404168+00:00 app[web.1]:     at Socket.emit (events.js:211:7)
2020-01-29T21:25:51.404170+00:00 app[web.1]:     at addChunk (_stream_readable.js:263:12)
2020-01-29T21:25:51.404172+00:00 app[web.1]:     at readableAddChunk (_stream_readable.js:250:11)
2020-01-29T21:25:51.404174+00:00 app[web.1]:     at Socket.Readable.push (_stream_readable.js:208:10)
2020-01-29T21:25:51.404175+00:00 app[web.1]:     at TCP.onread (net.js:601:20)
2020-01-29T21:25:51.404180+00:00 app[web.1]:      name: 'error',
2020-01-29T21:25:51.404182+00:00 app[web.1]:      length: 108,
2020-01-29T21:25:51.404184+00:00 app[web.1]:      severity: 'ERROR',
2020-01-29T21:25:51.404186+00:00 app[web.1]:      code: '42P01',
2020-01-29T21:25:51.404188+00:00 app[web.1]:      detail: undefined,
2020-01-29T21:25:51.404189+00:00 app[web.1]:      hint: undefined,
2020-01-29T21:25:51.404191+00:00 app[web.1]:      position: '63',
2020-01-29T21:25:51.404193+00:00 app[web.1]:      internalPosition: undefined,
2020-01-29T21:25:51.404195+00:00 app[web.1]:      internalQuery: undefined,
2020-01-29T21:25:51.404197+00:00 app[web.1]:      where: undefined,
2020-01-29T21:25:51.404199+00:00 app[web.1]:      schema: undefined,
2020-01-29T21:25:51.404201+00:00 app[web.1]:      table: undefined,
2020-01-29T21:25:51.404202+00:00 app[web.1]:      column: undefined,
2020-01-29T21:25:51.404204+00:00 app[web.1]:      dataType: undefined,
2020-01-29T21:25:51.404206+00:00 app[web.1]:      constraint: undefined,
2020-01-29T21:25:51.404208+00:00 app[web.1]:      file: 'parse_relation.c',
2020-01-29T21:25:51.404210+00:00 app[web.1]:      line: '1180',
2020-01-29T21:25:51.404212+00:00 app[web.1]:      routine: 'parserOpenTable',
2020-01-29T21:25:51.404215+00:00 app[web.1]:      sql: 'SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = \'asdasd\' LIMIT 1;',
2020-01-29T21:25:51.404217+00:00 app[web.1]:      parameters: undefined },
2020-01-29T21:25:51.404219+00:00 app[web.1]:   sql: 'SELECT "id", "company_token", "created_at", "updated_at" FROM "companies" AS "companies" WHERE "companies"."company_token" = \'asdasd\' LIMIT 1;',
2020-01-29T21:25:51.404221+00:00 app[web.1]:   parameters: undefined }
christocracy commented 4 years ago

Please don’t spam the thread with an immense amount of logs. It’s annoying to scroll through.

You didn’t notice this?

SequelizeDatabaseError: relation "companies" does not exist

sparkmobi commented 4 years ago

Please don’t spam the thread with an immense amount of logs. It’s annoying to scroll through.

You didn’t notice this?

SequelizeDatabaseError: relation "companies" does not exist

Sorry for that, i have checked heroku-postgres and found that it is empty, while i have followed your steps to install it on heroku, is there a command should i run so it can create data in postgres , i am trying to install the server for about 3 days now with no success

Sigura commented 4 years ago

@sparkmobi Could you please use script for DB creation?

Auto creation turns off for production use.

Buthrakaur commented 4 years ago

Hello @Sigura , I just installed current master version (ebdfd89b6e3be4fe947fa68afcf8b4da27317cc4), use default SQLite database and get the same error:

2020-04-27T18:47:44.490104864Z    { Error: SQLITE_ERROR: no such table: companies
2020-04-27T18:47:44.490116264Z      errno: 1,
2020-04-27T18:47:44.490120464Z      code: 'SQLITE_ERROR',
2020-04-27T18:47:44.490123864Z      sql:
2020-04-27T18:47:44.490127164Z       'SELECT `id`, `company_token`, `created_at`, `updated_at` FROM `companies` AS `companies` WHERE `companies`.`company_token` = \'smg\' LIMIT 1;' },

How should I initialize the DB when running on SQLite? I guess it should be initialized automatically during the initial app startup - is this a bug or is there just any docs missing?