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

TypeScript example fails to start #1349

Closed
Kaszanas opened this issue Jul 27, 2023 · 8 comments · Fixed by #1350
Closed

TypeScript example fails to start #1349

Kaszanas opened this issue Jul 27, 2023 · 8 comments · Fixed by #1350

Comments

@Kaszanas
Copy link

Looking at the main README file I was pointed towards: https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo/ts-example

When running the specified command:

docker-compose up --build node-server envoy ts-client

The following happens:

[+] Running 5/5
 ✔ Network grpc-web-master_default          Created                                                          0.1s 
 ✔ Container grpc-web-master-prereqs-1      Created                                                          1.8s 
 ✔ Container grpc-web-master-node-server-1  Created                                                          0.1s 
 ✔ Container grpc-web-master-ts-client-1    Created                                                          0.2s 
 ✔ Container grpc-web-master-envoy-1        Created                                                          0.1s 
Attaching to grpc-web-master-envoy-1, grpc-web-master-node-server-1, grpc-web-master-ts-client-1
grpc-web-master-ts-client-1    | node:internal/modules/cjs/loader:1085
grpc-web-master-ts-client-1    |   throw err;
grpc-web-master-ts-client-1    |   ^
grpc-web-master-ts-client-1    | 
grpc-web-master-ts-client-1    | Error: Cannot find module '/var/www/html/python'
grpc-web-master-ts-client-1    |     at Module._resolveFilename (node:internal/modules/cjs/loader:1082:15)        
grpc-web-master-ts-client-1    |     at Module._load (node:internal/modules/cjs/loader:928:27)
grpc-web-master-ts-client-1    |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
grpc-web-master-ts-client-1    |     at node:internal/main/run_main_module:23:47 {
grpc-web-master-ts-client-1

This is without any changes to the code and on master branch, which is the only one available.

@sampajano
Copy link
Collaborator

Hi thanks for the report! I'm able to reproduce this.. Will work on a fix soon thanks!

@sampajano
Copy link
Collaborator

@Kaszanas Thanks so much for reporting the issue. It should be fixed now! Please try again thanks! 😃

@Kaszanas
Copy link
Author

Will try to run the fix as soon as possible, and let you know if it works 😉.

@Kaszanas
Copy link
Author

Unfortunately, I think it did not help:

 => ERROR [prereqs prepare 9/9] RUN ./scripts/init_submodules.sh                                            0.5s 
------
 > [prereqs prepare 9/9] RUN ./scripts/init_submodules.sh:
0.454 /bin/sh: 1: ./scripts/init_submodules.sh: not found
------
failed to solve: process "/bin/sh -c ./scripts/init_submodules.sh" did not complete successfully: exit code: 127 

@sampajano so #1350 didn't help :\

@sampajano
Copy link
Collaborator

@Kaszanas Thanks for the update!

At least it looks like you're getting a different error now.. :)

This is interesting because previously you have successfully built this prereqs image, and the error happened during a later stage when the dependent images are ran (which i had fixed).

This error is unexpected (since the file exists) and i cannot reproduce locally.

Could you try something like the docker builder prune and rebuilding?

If that doesn't work, can you try to do a clean checkout from github and try again?

Hope that would work for you :)

@Kaszanas
Copy link
Author

  1. ran the docker builder prune
  2. ran the command docker-compose up --build node-server envoy ts-client from the root dir.

Same error:

 => ERROR [prereqs prepare 9/9] RUN ./scripts/init_submodules.sh                                                                                                                                                                           0.5s
------
 > [prereqs prepare 9/9] RUN ./scripts/init_submodules.sh:
0.447 /bin/sh: 1: ./scripts/init_submodules.sh: not found
------
failed to solve: process "/bin/sh -c ./scripts/init_submodules.sh" did not complete successfully: exit code: 127

This is on a fresh clone.

@sampajano
Copy link
Collaborator

sampajano commented Jul 31, 2023

Thanks for trying..

Not sure what's going on.. Since i'm not able to reproduce, you probably need to debug more and see what's wrong..

One thing you can do is to comment out later half of the docker file starting from this line:

RUN ./scripts/init_submodules.sh

then you can first build it using docker compose build prereqs then attach to the built image with something like:

docker run --rm -it --entrypoint bash grpcweb/prereqs

where you can try manually run ./scripts/init_submodules.sh and investigate why the file was not found. :)

Kaszanas added a commit to Kaszanas/grpc-web that referenced this issue Jul 31, 2023
The problem with building the docker-compose example was due to the additional line copying the `init_submodule.sh` script from the context. The line just above was cloning the repository though, so there is no need to COPY that script.
@Kaszanas
Copy link
Author

I have opened a new issue on this, discovered further errors and issues. Fixed the one on initial stages of prereqs. If you can review, please do @sampajano

New issue; #1353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants