forscht / ddrive

Discord as a filesystem.
https://ddrive.forscht.dev
MIT License
475 stars 90 forks source link

Getting error while deploying #70

Closed Atharv-Pathak-14 closed 1 year ago

Atharv-Pathak-14 commented 1 year ago

Whenever I deploy and try to click the upload button on the website I get this error and the button isn't working at all

{"level":30,"time":1676437037068,"reqId":"req-1e","req":{"method":"GET","url":"/api/directories/","hostname":"ddrive-production-9901.up.railway.app","remoteAddress":"10.10.10.15","remotePort":58094},"msg":"incoming request"} {"level":50,"time":1676437037107,"err":{"type":"DatabaseError","message":"select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist","stack":"error: select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist\n at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/app/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:513:28)\n at addChunk (node:internal/streams/readable:315:12)\n at readableAddChunk (node:internal/streams/readable:289:9)\n at Socket.Readable.push (node:internal/streams/readable:228:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)","length":109,"name":"error","severity":"ERROR","code":"42P01","position":"372","file":"parse_relation.c","line":"1373","routine":"parserOpenTable"},"msg":"select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist"} {"level":30,"time":1676437037109,"reqId":"req-1e","res":{"statusCode":500},"responseTime":40.103023529052734,"msg":"request completed"} {"level":30,"time":1676437037121,"reqId":"req-1f","req":{"method":"GET","url":"/api/directories/","hostname":"ddrive-production-9901.up.railway.app","remoteAddress":"10.10.10.15","remotePort":58090},"msg":"incoming request"} {"level":50,"time":1676437037124,"err":{"type":"DatabaseError","message":"select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist","stack":"error: select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist\n at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:287:98)\n at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)\n at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)\n at Socket. (/app/node_modules/pg-protocol/dist/index.js:11:42)\n at Socket.emit (node:events:513:28)\n at addChunk (node:internal/streams/readable:315:12)\n at readableAddChunk (node:internal/streams/readable:289:9)\n at Socket.Readable.push (node:internal/streams/readable:228:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)","length":109,"name":"error","severity":"ERROR","code":"42P01","position":"372","file":"parse_relation.c","line":"1373","routine":"parserOpenTable"},"msg":"select , (select json_agg(r) FROM (select \"d\"., sum(b.size) as size\n from \"directory\" as \"d\"\n left join \"block\" as \"b\" on \"d\".\"id\" = \"b\".\"fileId\"\n where \"d\".\"parentId\" = (select \"id\" from \"directory\" where \"parentId\" is null)\n group by \"d\".\"id\") r ) as child from \"directory\" where \"parentId\" is null limit $1 - relation \"directory\" does not exist"} {"level":30,"time":1676437037126,"reqId":"req-1f","res":{"statusCode":500},"responseTime":4.039794921875,"msg":"request completed"}

forscht commented 1 year ago

You need to run the migration to create database tables. npm run migration:up

edgehub-cloud commented 1 year ago

@forscht npm run migrration:up gives both error on digitalocean url (post) and both on local one

Unable to acquire a connection Error: Unable to acquire a connection at Client_PG.acquireConnection (/root/ddrive/node_modules/knex/lib/client.js:303:13) at Runner.ensureConnection (/root/ddrive/node_modules/knex/lib/execution/runner.js:287:46) at Runner.run (/root/ddrive/node_modules/knex/lib/execution/runner.js:30:30) at Target.then (/root/ddrive/node_modules/knex/lib/builder-interface-augmenter.js:24:43) at ensureTable (/root/ddrive/node_modules/knex/lib/migrations/migrate/table-creator.js:12:6) at listCompleted (/root/ddrive/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js:12:9) at Object.listAllAndCompleted (/root/ddrive/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js:25:5) at Migrator.up (/root/ddrive/node_modules/knex/lib/migrations/migrate/Migrator.js:106:57) at /root/ddrive/node_modules/knex/bin/cli.js:268:46

ShivamB25 commented 1 year ago

@forscht same error

forscht commented 1 year ago

Please checkout this setup tutorial - https://www.youtube.com/watch?v=Zvr1BHjrYC0