Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend-prod crashes upon start #77

Closed
fubz opened this issue Jan 23, 2022 · 5 comments
Closed

backend-prod crashes upon start #77

fubz opened this issue Jan 23, 2022 · 5 comments
Assignees
Labels
bug Something isn't working feedback

Comments

@fubz
Copy link

fubz commented Jan 23, 2022

Describe the bug
backend-prod code or docker-file is not ready to run from a fresh git clone

To Reproduce
Steps to reproduce the behavior:

  1. git clone the project to start fresh
  2. follow the README instructions
  3. run bash start.sh
  4. See error
backend-prod   | npm ERR! A complete log of this run can be found in:
backend-prod   | npm ERR!     /root/.npm/_logs/2022-01-23T16_38_20_916Z-debug.log
backend-prod   | 
backend-prod   | > backend@0.0.1 start:prod /app
backend-prod   | > node dist/main
backend-prod   | 
backend-prod   | internal/modules/cjs/loader.js:905
backend-prod   |   throw err;
backend-prod   |   ^
backend-prod   | 
backend-prod   | Error: Cannot find module '/app/dist/main'
backend-prod   |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
backend-prod   |     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
backend-prod   |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
backend-prod   |     at internal/main/run_main_module.js:17:47 {
backend-prod   |   code: 'MODULE_NOT_FOUND',
backend-prod   |   requireStack: []
backend-prod   | }
backend-prod   | npm ERR! code ELIFECYCLE
backend-prod   | npm ERR! errno 1
backend-prod   | npm ERR! backend@0.0.1 start:prod: `node dist/main`

Expected behavior
Project should be able to start per instructions

Desktop (please complete the following information):

  • Ubuntu 20
@fubz fubz added bug Something isn't working feedback labels Jan 23, 2022
@bartolomej
Copy link
Member

bartolomej commented Jan 23, 2022

Hey @fubz, thanks for submitting this bug!

I've published a fix on master. Try pulling new commits from master and running flowser one more time, let us know if everything works fine.

Note

I've changed the bash command for managing flowser a bit. Now you need to run bash run.sh start in order to start flowser.

Also stop the current instance of flowser and remove the backend image with docker rmi $(docker images backend -a -q) command before retrying, just in case.

@fubz
Copy link
Author

fubz commented Jan 23, 2022

back-end starts now! After a little reconfiguring of my flow.json I was able to deploy my emulator contracts; however, the dev-wallet throws an internal server error (HTTP 500)

dev-wallet     | TX:ERROR Error: Response closed without headers
dev-wallet     |     at Object.onEnd (/app/node_modules/@onflow/sdk/dist/sdk.js:1:10252)
dev-wallet     |     at /app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:24233
dev-wallet     |     at /app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:11490
dev-wallet     |     at Array.forEach (<anonymous>)
dev-wallet     |     at e.rawOnError (/app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:11452)
dev-wallet     |     at e.onTransportEnd (/app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:10318)
dev-wallet     |     at ClientRequest.<anonymous> (/app/node_modules/@improbable-eng/grpc-web-node-http-transport/lib/index.js:64:27)
dev-wallet     |     at ClientRequest.emit (node:events:390:28)
dev-wallet     |     at Socket.socketErrorListener (node:_http_client:442:9)
dev-wallet     |     at Socket.emit (node:events:390:28)

Any idea what might be going wrong here? I get the same error whether I call the Login or Signup functionality.
My flow configuration specifies the wallet at: "discovery.wallet": "http://localhost:8701/fcl/authn" Which is the port flowser is launching the dev wallet on.

Thank you!

@bartolomej
Copy link
Member

@fubz Awesome!

Regarding the dev-wallet error, I need just a few more details:

Did you use your own emulator instance (started emulator by yourself with flow emulator command) ? If so, did you click on the "EMULATOR" option in start screen ?

@fubz
Copy link
Author

fubz commented Jan 24, 2022

I did not use my own emulator instance. It is my understanding that flowser comes with it's own wallet instance. I do see the dev-wallet starts up with docker-compose

dev-wallet     | 
dev-wallet     | > fcl-dev-wallet@0.3.0 start
dev-wallet     | > next start
dev-wallet     | 
dev-wallet     | ready - started server on 0.0.0.0:8701, url: http://localhost:8701

My flow.json configuration is configured for the proper port of the dev-wallet

flow.json

 "devWallet": {
    "accessNode": {
      "endpoint": "http://localhost:8080"
    },
    "port": 8701
  },

Please let me know what other details I may be able to provide.

@bartolomej
Copy link
Member

Hey @fubz, sorry for the late reply. If you ran a "custom" flowser project (created with a click on "add custom project" button in start menu) this shouldn't have happened, because fcl-dev-wallet is connected to the emulator instance that is ran by flowser when you use your custom project.

The issue is that we can't yet support fcl-dev-wallet integration for "user-managed emulator" projects, because of the limitations in fcl-dev-wallet configuration, as discussed in this issue: #72

If you indeed encountered this error when using your custom project, please create a seperate issue and provide step by step instructions on how to reproduce it, because I wasn't able to reproduce it by myself.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback
Projects
None yet
Development

No branches or pull requests

2 participants