graphile / starter

Opinionated SaaS quick-start with pre-built user account and organization system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, GraphQL Code Generator, Ant Design and Next.js
https://graphile-starter.herokuapp.com
Other
1.73k stars 214 forks source link

Question: Why am I unable to connect? #376

Closed dancesWithCycles closed 4 months ago

dancesWithCycles commented 4 months ago

Hi folks, Thank you so much for providing and maintaining this repository. Kudos!

Summary

I called this instruction set according tor the readme.md to run my own Grahile Starter instance.

cd ~/Downloads
wget https://github.com/graphile/starter/archive/refs/tags/v4.1.0.tar.gz
tar -xzf starter-4.1.0.tar.gz
cd starter-4.1.0
sudo npm install -g yarn
git init
git add .
git commit -m 'Graphile Starter base'
yarn
yarn setup
yarn start

I loaded the application in a browser

http://localhost:5678

to get

Unable to connect

as response.

This is what the terminal is reporting. Any ideas how to continue?

yarn start
yarn run v1.22.21
$ node ./scripts/start.js
@app/graphql: [14:15:58] Parse configuration [started]
@app/graphql: [14:15:58] Parse configuration [completed]
@app/graphql: [14:15:58] Generate outputs [started]
@app/graphql: [14:15:58] Generate index.tsx [started]
@app/graphql: [14:15:58] Load GraphQL schemas [started]
@app/graphql: [14:15:58] Load GraphQL schemas [completed]
@app/graphql: [14:15:58] Load GraphQL documents [started]
@app/graphql: [14:15:58] Load GraphQL documents [completed]
@app/graphql: [14:15:58] Generate [started]
@app/graphql: [14:15:59] Generate [completed]
@app/graphql: [14:15:59] Generate index.tsx [completed]
@app/graphql: [14:15:59] Generate outputs [completed]
(TSC) 
(TSC) 14:15:59 - Starting compilation in watch mode...
(TSC) 
(TSC) 
(TSC) 14:15:59 - Found 0 errors. Watching for file changes.
(RUN) @app/worker: Debugger listening on ws://127.0.0.1:9757/692d60ad-85a0-4ac0-80d9-d31b9ba571c1
(RUN) @app/worker: For help, see: https://nodejs.org/en/docs/inspector
(RUN) @app/server: [nodemon] 2.0.7
(RUN) @app/server: [nodemon] to restart at any time, enter `rs`
(RUN) @app/server: [nodemon] watching path(s): dist/**/*.js
(RUN) @app/server: [nodemon] watching extensions: js,mjs,json
(RUN) @app/server: [nodemon] starting `node --inspect=9678 -r @app/config/env -r source-map-support/register dist/index.js`
(RUN) @app/server: Debugger listening on ws://127.0.0.1:9678/53ce70c6-bb9f-479a-94eb-5d6199f21deb
(RUN) @app/server: For help, see: https://nodejs.org/en/docs/inspector
(WATCH) @app/db: graphile-migrate: Already up to date
(WATCH) @app/db: [2024-03-13T13:16:01.394Z]: Running current.sql
(WATCH) @app/graphql: [14:16:01] Parse configuration [started]
(WATCH) @app/graphql: [14:16:01] Parse configuration [completed]
(WATCH) @app/graphql: [14:16:01] Generate outputs [started]
(WATCH) @app/graphql: [14:16:01] Generate index.tsx [started]
(WATCH) @app/graphql: [14:16:01] Load GraphQL schemas [started]
(RUN) @app/server: My_Project_Here listening on port 5678
(RUN) @app/server:   Site:     http://localhost:5678
(RUN) @app/server:   GraphiQL: http://localhost:5678/graphiql
(WATCH) @app/graphql: [14:16:01] Load GraphQL schemas [completed]
(WATCH) @app/graphql: [14:16:01] Load GraphQL documents [started]
(WATCH) @app/db: [2024-03-13T13:16:01.549Z]: current.sql unchanged, skipping migration
(WATCH) @app/graphql: [14:16:01] Load GraphQL documents [completed]
(WATCH) @app/graphql: [14:16:01] Generate [started]
(WATCH) @app/db: [2024-03-13T13:16:01.630Z]: Finished (236ms)
(RUN) @app/worker: [core] INFO: Worker connected and looking for jobs... (task names: 'organization_invitations__send_invite', 'send_email', 'user__audit', 'user__forgot_password', 'user__forgot_password_unregistered_email', 'user__send_delete_account_email', 'user_emails__send_verification')
(WATCH) @app/graphql: [14:16:01] Generate [completed]
(WATCH) @app/graphql: [14:16:01] Generate index.tsx [completed]
(WATCH) @app/graphql: [14:16:01] Generate outputs [completed]
(WATCH) @app/graphql:   ℹ Watching for changes...
(RUN) @app/server: info  - Using webpack 4. Reason: custom webpack configuration in next.config.js https://nextjs.org/docs/messages/webpack5
(RUN) @app/server: Warning: Reverting webpack devtool to 'eval-source-map'.
(RUN) @app/server: Changing the webpack devtool in development mode will cause severe performance regressions.
(RUN) @app/server: Read more: https://nextjs.org/docs/messages/improper-devtool
(RUN) @app/server: Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
(RUN) @app/server: See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled
(RUN) @app/server: Error: error:0308010C:digital envelope routines::unsupported
(RUN) @app/server:     at new Hash (node:internal/crypto/hash:69:19)
(RUN) @app/server:     at Object.createHash (node:crypto:133:10)
(RUN) @app/server:     at module.exports.__webpack_modules__.15660.module.exports (/home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:111680:62)
(RUN) @app/server:     at NormalModule._initBuildHash (/home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:85092:16)
(RUN) @app/server:     at handleParseError (/home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:85146:10)
(RUN) @app/server:     at /home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:85178:5
(RUN) @app/server:     at /home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:85033:12
(RUN) @app/server:     at /home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:51096:3
(RUN) @app/server:     at iterateNormalLoaders (/home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:50937:10)
(RUN) @app/server:     at Array.<anonymous> (/home/begerad/Downloads/starter-4.1.0/node_modules/next/dist/compiled/webpack/bundle4.js:50928:4)
(RUN) @app/server: [nodemon] app crashed - waiting for file changes before starting...
(TEST) graphile-migrate[shadow]: dropped database 'graphile_starter_test'
(TEST) graphile-migrate[shadow]: recreated database 'graphile_starter_test'
(TEST) Schema updated
(TEST) 
(TEST) graphile-migrate[shadow]: Running migration '000001.sql'
(TEST) graphile-migrate[shadow]: 1 committed migrations executed
(TEST) graphile-migrate[shadow]: Already up to date
(TEST) [2024-03-13T13:16:17.533Z]: Running current.sql
(TEST) [2024-03-13T13:16:18.164Z]: Finished (631ms; excluding actions: 313ms)
(TEST) [jest] Debugger listening on ws://127.0.0.1:9876/36e97ce9-3416-418e-915f-6f50c8cdd059
(TEST) [jest] For help, see: https://nodejs.org/en/docs/inspector
(TEST) [jest] Browserslist: caniuse-lite is outdated. Please run:
(TEST) [jest] npx browserslist@latest --update-db
(TEST) [jest] 
(TEST) [jest] Why you should do it regularly:
(TEST) [jest] https://github.com/browserslist/browserslist#browsers-data-updating
(TEST) [testdb] graphile-migrate[shadow]: Already up to date
(TEST) [testdb] [2024-03-13T13:16:19.897Z]: Running current.sql
(TEST) [testdb] [2024-03-13T13:16:20.107Z]: current.sql unchanged, skipping migration
(TEST) [testdb] [2024-03-13T13:16:20.223Z]: Finished (325ms)
(TEST) [jest]  FAIL   @app/db  @app/db/__tests__/app_public/tables/user_emails.test.ts (9.039 s)
(TEST) [jest]   ● cannot manually create a verified email
(TEST) [jest] 
(TEST) [jest]     expect(received).rejects.toThrow(expected)
(TEST) [jest] 
(TEST) [jest]     Expected pattern: /permission denied for (table|relation) user_emails/
(TEST) [jest]     Received message: "keine Berechtigung für Tabelle user_emails"
(TEST) [jest] 
(TEST) [jest]           at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
(TEST) [jest]           at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
(TEST) [jest]           at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
(TEST) [jest]           at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)
(TEST) [jest] 
(TEST) [jest]       52 |       ["newemail@example.com"]
(TEST) [jest]       53 |     );
(TEST) [jest]     > 54 |     await expect(promise).rejects.toThrow(
(TEST) [jest]          |                                   ^
(TEST) [jest]       55 |       /permission denied for (table|relation) user_emails/
(TEST) [jest]       56 |     );
(TEST) [jest]       57 |   }));
(TEST) [jest] 
(TEST) [jest]       at Object.toThrow (../../node_modules/expect/build/index.js:242:22)
(TEST) [jest]       at fn (__tests__/app_public/tables/user_emails.test.ts:54:35)
(TEST) [jest]       at __tests__/helpers.ts:75:11
(TEST) [jest]       at withDbFromUrl (__tests__/helpers.ts:52:5)
(TEST) [jest] 
(TEST) [jest]   ● cannot manually mark an email as verified
(TEST) [jest] 
(TEST) [jest]     expect(received).rejects.toThrow(expected)
(TEST) [jest] 
(TEST) [jest]     Expected pattern: /permission denied for (table|relation) user_emails/
(TEST) [jest]     Received message: "keine Berechtigung für Tabelle user_emails"
(TEST) [jest] 
(TEST) [jest]           at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
(TEST) [jest]           at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
(TEST) [jest]           at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
(TEST) [jest]           at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)
(TEST) [jest] 
(TEST) [jest]       64 |       [email.id]
(TEST) [jest]       65 |     );
(TEST) [jest]     > 66 |     await expect(promise).rejects.toThrow(
(TEST) [jest]          |                                   ^
(TEST) [jest]       67 |       /permission denied for (table|relation) user_emails/
(TEST) [jest]       68 |     );
(TEST) [jest]       69 |   }));
(TEST) [jest] 
(TEST) [jest]       at Object.toThrow (../../node_modules/expect/build/index.js:242:22)
(TEST) [jest]       at __tests__/app_public/tables/user_emails.test.ts:66:35
(TEST) [jest]       at __tests__/helpers.ts:75:5
(TEST) [jest]       at withDbFromUrl (__tests__/helpers.ts:52:5)
(TEST) [jest] 
(TEST) [jest]  FAIL   @app/db  @app/db/__tests__/app_private/functions/link_or_register_user.test.ts
(TEST) [jest]   ● when account doesn't already exist › cannot register with invalid email
(TEST) [jest] 
(TEST) [jest]     expect(received).rejects.toThrowErrorMatchingInlineSnapshot(snapshot)
(TEST) [jest] 
(TEST) [jest]     Snapshot name: `when account doesn't already exist cannot register with invalid email 1`
(TEST) [jest] 
(TEST) [jest]     Snapshot: "new row for relation \"user_emails\" violates check constraint \"user_emails_email_check\""
(TEST) [jest]     Received: "neue Zeile für Relation »user_emails« verletzt Check-Constraint »user_emails_email_check«"
(TEST) [jest] 
(TEST) [jest]       112 |         {}
(TEST) [jest]       113 |       );
(TEST) [jest]     > 114 |       await expect(promise).rejects.toThrowErrorMatchingInlineSnapshot(
(TEST) [jest]           |                                     ^
(TEST) [jest]       115 |         `"new row for relation \\"user_emails\\" violates check constraint \\"user_emails_email_check\\""`
(TEST) [jest]       116 |       );
(TEST) [jest]       117 |       await expect(promise).rejects.toMatchObject({
(TEST) [jest] 
(TEST) [jest]       at Object.toThrowErrorMatchingInlineSnapshot (../../node_modules/expect/build/index.js:242:22)
(TEST) [jest]       at fn (__tests__/app_private/functions/link_or_register_user.test.ts:114:37)
(TEST) [jest]       at withDbFromUrl (__tests__/helpers.ts:52:11)
(TEST) [jest] 
(TEST) [jest]  › 1 snapshot failed.
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/reset_password.test.ts (8.239 s)
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/invite_to_organization.test.ts (6.009 s)
(TEST) [jest]   ● Console
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       Not sending audit announcement for user '8cff1b68-e6e6-41b9-b832-724efeba781e' because it occurred immediately after account creation. (Tried to audit: You added the email 'a@b.c' to your account.)
(TEST) [jest] 
(TEST) [jest]       at task (../worker/src/tasks/user__audit.ts:135:13)
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       [worker(worker-c29d349c83907d7cdc)] INFO: Completed task 123 (user__audit) with success (116.81ms)
(TEST) [jest] 
(TEST) [jest]       at Logger.log (../../node_modules/@graphile/logger/src/index.ts:194:22)
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       Not sending audit announcement for user '6cc0f3e7-eeef-4732-872e-7d93cf0fdaa8' because it occurred immediately after account creation. (Tried to audit: You added the email 'b@b.c' to your account.)
(TEST) [jest] 
(TEST) [jest]       at task (../worker/src/tasks/user__audit.ts:135:13)
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       [worker(worker-c29d349c83907d7cdc)] INFO: Completed task 124 (user__audit) with success (57.37ms)
(TEST) [jest] 
(TEST) [jest]       at Logger.log (../../node_modules/@graphile/logger/src/index.ts:194:22)
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       [worker(worker-c29d349c83907d7cdc)] INFO: Completed task 125 (organization_invitations__send_invite) with success (327.74ms)
(TEST) [jest] 
(TEST) [jest]       at Logger.log (../../node_modules/@graphile/logger/src/index.ts:194:22)
(TEST) [jest] 
(TEST) [jest]     console.info
(TEST) [jest]       [worker(worker-c29d349c83907d7cdc)] INFO: Completed task 126 (send_email) with success (75.21ms)
(TEST) [jest] 
(TEST) [jest]       at Logger.log (../../node_modules/@graphile/logger/src/index.ts:194:22)
(TEST) [jest] 
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/confirm_account_deletion.test.ts
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_private/functions/login.test.ts
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/forgot_password.test.ts
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/change_password.test.ts
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_public/functions/logout.test.ts
(TEST) [jest]  PASS   @app/db  @app/db/__tests__/app_private/functions/really_create_user.test.ts
(TEST) [jest] 
(TEST) [jest] Snapshot Summary
(TEST) [jest]  › 1 snapshot failed from 1 test suite. Inspect your code changes or press `u` to update them.
(TEST) [jest] 
(TEST) [jest] Test Suites: 2 failed, 8 passed, 10 total
(TEST) [jest] Tests:       3 failed, 65 passed, 68 total
(TEST) [jest] Snapshots:   1 failed, 31 passed, 32 total
(TEST) [jest] Time:        40.307 s
(TEST) [jest] Ran all test suites related to changed files.
(TEST) [jest] 
benjie commented 4 months ago
(RUN) @app/server: Error: error:0308010C:digital envelope routines::unsupported

^ I think this is the critical line. It hints at crypto incompatibilities; probably your version of Node is too new for your version of starter. Please try cloning the latest starter, and if that doesn't work, try using progressively older versions of Node. I can't remember what starter was written with... Maybe Node 12?! I'd try Node 16 first, personally.

dancesWithCycles commented 4 months ago

Maybe Node 12?! I'd try Node 16 first, personally.

Cheers mate! This did the trick!

$ nvm install v16.20.2
$ node --version
v16.20.2