ParabolInc / parabol

Free online agile retrospective meeting tool
https://www.parabol.co/
Other
1.91k stars 327 forks source link

App not working after execution yarn && yarn build && yarn start #7046

Closed kastyle closed 2 years ago

kastyle commented 2 years ago

Issue - Bug

Hi all. Please help me solve the problem. I am trying to deploy an application. The first thing I do (seen in this comment)

yarn install && yarn db:start && yarn db:migrate && yarn db:migrate up && yarn pg:build

Next, I do: yarn && yarn build && yarn start

The deployment runs without errors, but at localhost:3000 I see only a white page. log:

yarn && yarn build && yarn start
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "immutable@3.8.2" is incompatible with requested version "immutable@~3.7.6"
warning Resolution field "git-url-parse@12.0.0" is incompatible with requested version "git-url-parse@^11.4.4"
warning Resolution field "immutable@3.8.2" is incompatible with requested version "immutable@~3.7.6"
warning Resolution field "immutable@3.8.2" is incompatible with requested version "immutable@~3.7.4"
warning Resolution field "immutable@3.8.2" is incompatible with requested version "immutable@~3.7.4"
warning Resolution field "immutable@3.8.2" is incompatible with requested version "immutable@~3.7.4"
success Already up-to-date.
$ husky install
husky - Git hooks installed
Done in 1.11s.
yarn run v1.22.19
$ node scripts/prod.js
πŸ™πŸ™πŸ™      Building Production Server      πŸ™πŸ™πŸ™

Writing ts
β ‹ Parse Configuration
βœ” Parse Configuration
βœ” Generate outputs
Added 0 records to the queryMap
Done in 137.65s.
yarn run v1.22.19
$ pm2-runtime start pm2.config.js
2022-08-11T13:31:01: PM2 log: Launching in no daemon mode
2022-08-11T13:31:01: PM2 log: App [Web Server:0] starting in -cluster mode-
2022-08-11T13:31:01: PM2 log: App [GQL Executor:1] starting in -cluster mode-
2022-08-11T13:31:01: PM2 log: App [Web Server:0] online
2022-08-11T13:31:01: PM2 log: App [GQL Executor:1] online
2022-08-11T13:31:01: PM2 log: App [GQL Executor:2] starting in -cluster mode-
2022-08-11T13:31:02: PM2 log: App [GQL Executor:2] online
πŸ”₯πŸ”₯πŸ”₯ Ready for Sockets: Port 3000 πŸ”₯πŸ”₯πŸ”₯
πŸ’§πŸ’§πŸ’§ Ready for GraphQL Execution: 0 πŸ’§πŸ’§πŸ’§
πŸ’§πŸ’§πŸ’§ Ready for GraphQL Execution: 1 πŸ’§πŸ’§πŸ’§

Curl localhost:3000 shows this:

[root@rocky 14:09:02 parabol]# curl localhost:3000
<!doctype html><html lang="en"><head><script>window.__ACTION__={stripe:"pk_test_TYooMQauvdEDq54NiTphI7jx",prblIn:"localhost:3000/invitation-link",AUTH_INTERNAL_ENABLED:!0,AUTH_GOOGLE_ENABLED:!0,AUTH_SSO_ENABLED:!0}</script><script>gtmId=window.__ACTION__.googleTagManagerId,gtmIdValidation=/^GTM-[A-Z0-9]+$/,gtmId&&gtmIdValidation.test(gtmId)&&function(t,e,a,g,m){t[g]=t[g]||[],t[g].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var n=e.getElementsByTagName(a)[0],d=e.createElement(a);d.async=!0,d.src="https://www.googletagmanager.com/gtm.js?id="+m,n.parentNode.insertBefore(d,n)}(window,document,"script","dataLayer",gtmId)</script><title>Free Online Retrospectives | Parabol</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#493272"><meta name="description" data-react-helmet="true" content="Parabol is a free online retrospective tool. Try it without creating an account. Parabol features custom templates, powerful analytics, multi-user grouping, rich text editing, integrations, and gorgeous meeting summaries. Tasks are assigned and tracked so your team can continuously improve."><link href="/static/manifest.json" rel="manifest"><link href="https://action-files.parabol.co/static/favicon.ico" rel="shortcut icon" crossorigin=""><script defer src="key_CDN_BASE_URL/build/v6.70.0/app_187b2d90e4494de49239.js" onerror="fallback(this)" crossorigin=""></script></head><body><div id="root"></div><script>function fallback(c){const n=document.createElement("script");n.src=window.location.origin+"/static"+c.src.slice(c.src.lastIndexOf("/")),document.body.append(n)}</script></body></html>[root@rocky 14:09:06 parabol]# 

Please help me solve this problem. What do I need to do to make the application work?

87prashant commented 2 years ago

I am not sure about prod version, I work with dev version using below step:

If you want to run a dev version, all you need to do is yarn install && yarn db:start && yarn dev

kastyle commented 2 years ago

I am not sure about prod version, I work with dev version using below step:

If you want to run a dev version, all you need to do is yarn install && yarn db:start && yarn dev

@87prashant The dev version works, but I would like to try running the prod version.

kastyle commented 2 years ago

I also noticed one strange feature: If I deploy the dev version, then 2 ports are opened - 3000 (application) and 3001 (web socket).

[root@rocky2 10:30:25 ~]# ss -nltp
LISTEN   0         128                0.0.0.0:6379             0.0.0.0:*       users:(("docker-proxy",pid=2073,fd=4))                                            
LISTEN   0         128                0.0.0.0:28015            0.0.0.0:*       users:(("docker-proxy",pid=2094,fd=4))                                            
LISTEN   0         128                0.0.0.0:8080             0.0.0.0:*       users:(("docker-proxy",pid=2142,fd=4))                                            
LISTEN   0         128                0.0.0.0:80               0.0.0.0:*       users:(("nginx",pid=1035,fd=9),("nginx",pid=1034,fd=9),("nginx",pid=1031,fd=9))   
LISTEN   0         128                0.0.0.0:8082             0.0.0.0:*       users:(("docker-proxy",pid=1983,fd=4))                                            
LISTEN   0         128                0.0.0.0:22               0.0.0.0:*       users:(("sshd",pid=728,fd=4))                                                     
LISTEN   0         128                0.0.0.0:29015            0.0.0.0:*       users:(("docker-proxy",pid=2039,fd=4))                                            
LISTEN   0         128                0.0.0.0:5432             0.0.0.0:*       users:(("docker-proxy",pid=1965,fd=4))                                            
LISTEN   0         128                0.0.0.0:5050             0.0.0.0:*       users:(("docker-proxy",pid=2002,fd=4)) 
LISTEN   0         128                      *:3000                   *:*       users:(("node /root/para",pid=1359,fd=21))                                                                                 
LISTEN   0         128                      *:3001                   *:*       users:(("node /root/para",pid=1344,fd=24)) 

If I deploy the prod version, only 1 port is opened, 3000 (web socket). Perhaps this is the issue? I forgot to say that I'm trying to deploy a production version with a default .env file.

root@rocky 10:48:39 ~]# ss -nltp
State         Recv-Q        Send-Q               Local Address:Port                  Peer Address:Port        Process                                            
LISTEN        0             128                        0.0.0.0:6379                       0.0.0.0:*            users:(("docker-proxy",pid=3973,fd=4))            
LISTEN        0             128                        0.0.0.0:28015                      0.0.0.0:*            users:(("docker-proxy",pid=3955,fd=4))            
LISTEN        0             128                        0.0.0.0:8080                       0.0.0.0:*            users:(("docker-proxy",pid=3991,fd=4))            
LISTEN        0             128                        0.0.0.0:8082                       0.0.0.0:*            users:(("docker-proxy",pid=4033,fd=4))            
LISTEN        0             128                        0.0.0.0:22                         0.0.0.0:*            users:(("sshd",pid=740,fd=4))                     
LISTEN        0             128                        0.0.0.0:29015                      0.0.0.0:*            users:(("docker-proxy",pid=3937,fd=4))            
LISTEN        0             128                        0.0.0.0:5432                       0.0.0.0:*            users:(("docker-proxy",pid=4108,fd=4))            
LISTEN        0             128                        0.0.0.0:5050                       0.0.0.0:*            users:(("docker-proxy",pid=4518,fd=4))                   
LISTEN        0             128                              *:3000                             *:*            users:(("node /root/para",pid=4956,fd=24))        

Guys, please see this thread. Any of your help will be appreciated. @BartoszJarocki @Dschoordsch @igorlesnenko @tianrunhe @mattkrick

Dschoordsch commented 2 years ago

@kastyle It works when you remove CDN_BASE_URL from the .env file and re-run yarn build && yarn start. Would be nice, if you have time, if you could commit a PR with a better default value or commented out line in .env.example.

kastyle commented 2 years ago

@Dschoordsch Thanks, it worked, but I keep having deployment issues. I will definitely create a PR as soon as I can get the prod version up and running.

The web page now opens, but when adding an account, it says "Server error" In the log I see an entry: SEND TO SENTRY [Error: relation "User" does not exist] undefined

Commands I have run:

yarn install && yarn db:start && yarn db:migrate && yarn db:migrate up && yarn pg:build
yarn build && yarn start

I'm assuming this is due to deployment errors. Errors in the deployment log:

[root@rocky 12:26:43 parabol]# yarn pg:build
yarn run v1.22.19
$ pgtyped -c ./packages/server/postgres/pgtypedConfig.js
Processing packages/server/postgres/queries/src/addUserNewFeatureQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "User" does not exist',
  position: '8'
}
Saved 1 query types to packages/server/postgres/queries/generated/addUserNewFeatureQuery.ts
Processing packages/server/postgres/queries/src/appendTeamResponseReactjiQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "TeamPromptResponse" does not exist',
  position: '8'
}
Saved 1 query types to packages/server/postgres/queries/generated/appendTeamResponseReactjiQuery.ts
Processing packages/server/postgres/queries/src/appendUserFeatureFlagsQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "User" does not exist',
  position: '8'
}
Saved 1 query types to packages/server/postgres/queries/generated/appendUserFeatureFlagsQuery.ts
Processing packages/server/postgres/queries/src/appendUserTmsQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "User" does not exist',
  position: '8'
}
Saved 1 query types to packages/server/postgres/queries/generated/appendUserTmsQuery.ts
Processing packages/server/postgres/queries/src/archiveTeamsByTeamIdsQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "Team" does not exist',
  position: '8'
}
Saved 1 query types to packages/server/postgres/queries/generated/archiveTeamsByTeamIdsQuery.ts

etc...

Processing packages/server/postgres/queries/src/upsertTeamPromptResponsesQuery.sql
Error in query. Details: {
  errorCode: 'parserOpenTable',
  hint: undefined,
  message: 'relation "TeamPromptResponse" does not exist',
  position: '13'
}
Saved 1 query types to packages/server/postgres/queries/generated/upsertTeamPromptResponsesQuery.ts
Done in 2.76s.

[root@rocky 12:26:57 parabol]# yarn build && yarn start
yarn run v1.22.19
$ node scripts/prod.js
πŸ™πŸ™πŸ™      Building Production Server      πŸ™πŸ™πŸ™

Writing ts
β ‹ Parse Configuration
β—Ό Generate outputs
Created:
 - UpdateNewCheckInQuestionMutation_meeting.graphql.ts
 - SlackProviderRow_viewer.graphql.ts
 - SlackProviderRowViewer.graphql.ts

etc...

βœ” Parse Configuration
βœ” Generate outputs
Added 215 records to the queryMap
Prime Integrations error error: relation "IntegrationProvider" does not exist
    at Parser.parseErrorMessage (/root/parabol/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/root/parabol/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/root/parabol/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/root/parabol/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:520:28)
    at Socket.emit (node:domain:475:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 118,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '15',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1191',
  routine: 'parserOpenTable'
}
Done in 111.70s.
yarn run v1.22.19
$ pm2-runtime start pm2.config.js
2022-08-15T12:29:08: PM2 log: Launching in no daemon mode
2022-08-15T12:29:08: PM2 log: App [Web Server:0] starting in -cluster mode-
2022-08-15T12:29:08: PM2 log: App [GQL Executor:1] starting in -cluster mode-
2022-08-15T12:29:08: PM2 log: App [Web Server:0] online
2022-08-15T12:29:08: PM2 log: App [GQL Executor:1] online
2022-08-15T12:29:08: PM2 log: App [GQL Executor:2] starting in -cluster mode-
2022-08-15T12:29:08: PM2 log: App [GQL Executor:2] online
πŸ”₯πŸ”₯πŸ”₯ Ready for Sockets: Port 3000 πŸ”₯πŸ”₯πŸ”₯
πŸ’§πŸ’§πŸ’§ Ready for GraphQL Execution: 0 πŸ’§πŸ’§πŸ’§
πŸ’§πŸ’§πŸ’§ Ready for GraphQL Execution: 1 πŸ’§πŸ’§πŸ’§
SEND TO SENTRY [Error: relation "User" does not exist] undefined
SEND TO SENTRY [Error: relation "User" does not exist] undefined
SEND TO SENTRY [Error: relation "User" does not exist] undefined

Can you please tell me, what can I do to solve the problem?

Dschoordsch commented 2 years ago

You're missing yarn pg:migrate up, it should be yarn db:migrate && yarn pg:migrate up.

jordanh commented 2 years ago

Closing for now. Please re-open if you are still having issues