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

./scripts/init_submodules.sh: not found #819

Closed
dery168 opened this issue May 24, 2020 · 19 comments
Closed

./scripts/init_submodules.sh: not found #819

dery168 opened this issue May 24, 2020 · 19 comments

Comments

@dery168
Copy link

dery168 commented May 24, 2020

Window 10: Try to follow this and failed on last step.
$ git clone https://github.com/grpc/grpc-web
$ cd grpc-web
$ docker-compose pull
$ docker-compose up -d node-server envoy commonjs-client

Here is the console output:
PS C:\github> git clone https://github.com/grpc/grpc-web
Cloning into 'grpc-web'...
remote: Enumerating objects: 95, done.
remote: Counting objects: 100% (95/95), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 4706 (delta 19), reused 58 (delta 14), pack-reused 4611
Receiving objects: 100% (4706/4706), 911.77 KiB | 5.21 MiB/s, done.
Resolving deltas: 100% (2337/2337), done.
PS C:\github> cd grpc-web
PS C:\github\grpc-web> docker-compose pull
Pulling common ... done
Pulling prereqs ... done
Pulling grpc-base ... done
Pulling echo-server ... done
Pulling node-server ... done
Pulling node-interop-server ... done
Pulling envoy ... done
Pulling nginx ... done
Pulling grpcwebproxy ... done
Pulling commonjs-client ... done
Pulling closure-client ... done
Pulling ts-client ... done
Pulling binary-client ... done
Pulling interop-client ... done
WARNING: Some service image(s) must be built from source by running:
docker-compose build interop-client closure-client node-interop-server prereqs grpcwebproxy grpc-base binary-client echo-server nginx ts-client
PS C:\github\grpc-web> docker-compose up -d node-server envoy commonjs-client
Building prereqs
Step 1/18 : FROM grpcweb/common
---> c8ec1e686813
Step 2/18 : ARG MAKEFLAGS=-j8
---> Using cache
---> 5193700fd512
Step 3/18 : ARG BUILDIFIER_VERSION=1.0.0
---> Using cache
---> 805a4392af84
Step 4/18 : ARG BAZEL_VERSION=2.2.0
---> Using cache
---> 60213041609a
Step 5/18 : RUN echo "\nloglevel=error\n" >> $HOME/.npmrc
---> Using cache
---> 24ce4ae224ec
Step 6/18 : WORKDIR /github/grpc-web
---> Using cache
---> 824b0de4e01e
Step 7/18 : COPY ./Makefile ./Makefile
---> Using cache
---> f876f09b9683
Step 8/18 : COPY ./bazel ./bazel
---> Using cache
---> da18e70f7fe7
Step 9/18 : COPY ./javascript ./javascript
---> Using cache
---> 495bcd2cac24
Step 10/18 : COPY ./net ./net
---> Using cache
---> 439bc1048909
Step 11/18 : COPY ./packages ./packages
---> Using cache
---> 46ddafa3bf85
Step 12/18 : COPY ./scripts ./scripts
---> Using cache
---> 7e0e1cdfdeb5
Step 13/18 : COPY ./test ./test
---> Using cache
---> 1116ae0a37c5
Step 14/18 : RUN ./scripts/init_submodules.sh
---> Running in c6bc4a894ead
/bin/sh: 1: ./scripts/init_submodules.sh: not found
ERROR: Service 'prereqs' failed to build: The command '/bin/sh -c ./scripts/init_submodules.sh' returned a non-zero code: 127
PS C:\github\grpc-web> ls -l ./scripts/init_submodules.sh

Directory: C:\github\grpc-web\scripts

Mode LastWriteTime Length Name


-a---- 2020-05-23 11:25 PM 936 init_submodules.sh

@stanley-cheung
Copy link
Collaborator

That's ..... strange. This usually points to some sort of version mismatch (i.e. you are docker-pull'ing from one version but using the master for another), but even with that in mind, I don't quite see how that happen yet.

@stanley-cheung
Copy link
Collaborator

stanley-cheung commented May 25, 2020

It might help if, instead of doing docker pull docker-compose pull, you can just do a docker build docker-compose build common prereqs node-server envoy commonjs-client, before you do docker-compose up -d node-server envoy commonjs-client. That will build those images using the latest code. That might get rid of some sort of version mismatch.

@dery168
Copy link
Author

dery168 commented May 25, 2020

Thanks @stanley-cheung but No luck still the same error.

PS C:\Users\deryy> cd .\grpc-web\
PS C:\Users\deryy\grpc-web> docker build common prereqs node-server envoy commonjs-client
"docker build" requires exactly 1 argument.
See 'docker build --help'.

Usage:  docker build [OPTIONS] PATH | URL | -

Build an image from a Dockerfile
PS C:\Users\deryy\grpc-web> docker-compose build common prereqs node-server envoy commonjs-client
Building common
Step 1/8 : FROM node:10-stretch
10-stretch: Pulling from library/node
1c6172af85ee: Pull complete
b194b0e3c928: Pull complete
1f5ec00f35d5: Pull complete
93b1353672b6: Pull complete
3d7f38db3cca: Pull complete
21e102f9fe89: Pull complete
1f9c0020f4f4: Pull complete
5ab83c758454: Pull complete
654868f0dc71: Pull complete
Digest: sha256:0e2671bc0702132989b2b5142617d47c421bd304acd924fbff812370f6107db2
Status: Downloaded newer image for node:10-stretch
 ---> c5f1efe092a0
Step 2/8 : RUN apt-get -qq update && apt-get -qq install -y   unzip
 ---> Running in 203ca36ca73f
Removing intermediate container 203ca36ca73f
 ---> 6ab79bfd41f9
Step 3/8 : WORKDIR /tmp
 ---> Running in 42b75e237dc1
Removing intermediate container 42b75e237dc1
 ---> 2579793e2736
Step 4/8 : RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip -o protoc.zip &&   unzip -qq protoc.zip &&   cp ./bin/protoc /usr/local/bin/protoc
 ---> Running in 9ccb831881f8
Removing intermediate container 9ccb831881f8
 ---> 692c8ffac08a
Step 5/8 : RUN curl -sSL https://github.com/grpc/grpc-web/releases/download/1.0.7/protoc-gen-grpc-web-1.0.7-linux-x86_64 -o /usr/local/bin/protoc-gen-grpc-web &&   chmod +x /usr/local/bin/protoc-gen-grpc-web
 ---> Running in 5287045dee9a
Removing intermediate container 5287045dee9a
 ---> 6de8de2871a4
Step 6/8 : WORKDIR /var/www/html/dist
 ---> Running in cf1b311bc305
Removing intermediate container cf1b311bc305
 ---> 8ba6094a8116
Step 7/8 : WORKDIR /github/grpc-web
 ---> Running in c21589c6196d
Removing intermediate container c21589c6196d
 ---> 1e5bbd3222c1
Step 8/8 : RUN git clone https://github.com/grpc/grpc-web .
 ---> Running in 639060a9cf22
Cloning into '.'...
Removing intermediate container 639060a9cf22
 ---> 1cf64ec8b52d
Successfully built 1cf64ec8b52d
Successfully tagged grpcweb/common:latest
Building prereqs
Step 1/18 : FROM grpcweb/common
 ---> 1cf64ec8b52d
Step 2/18 : ARG MAKEFLAGS=-j8
 ---> Running in e7bdd7922d1e
Removing intermediate container e7bdd7922d1e
 ---> 5f64de76fefe
Step 3/18 : ARG BUILDIFIER_VERSION=1.0.0
 ---> Running in d41805916cd5
Removing intermediate container d41805916cd5
 ---> 93f81a2a25b1
Step 4/18 : ARG BAZEL_VERSION=2.2.0
 ---> Running in b7e49894fe01
Removing intermediate container b7e49894fe01
 ---> 22a204ef4fd7
Step 5/18 : RUN echo "\nloglevel=error\n" >> $HOME/.npmrc
 ---> Running in a5d6376862ba
Removing intermediate container a5d6376862ba
 ---> 3ba973e5ddb5
Step 6/18 : WORKDIR /github/grpc-web
 ---> Running in 4ac72d8c1a08
Removing intermediate container 4ac72d8c1a08
 ---> 643e67349a5c
Step 7/18 : COPY ./Makefile ./Makefile
 ---> a96a7278bee4
Step 8/18 : COPY ./bazel ./bazel
 ---> 8e8753ae4469
Step 9/18 : COPY ./javascript ./javascript
 ---> 30de9a4b504f
Step 10/18 : COPY ./net ./net
 ---> 034d981f2332
Step 11/18 : COPY ./packages ./packages
 ---> 61134e227ce5
Step 12/18 : COPY ./scripts ./scripts
 ---> 1f18f76e61e2
Step 13/18 : COPY ./test ./test
 ---> d0fa541d8fdf
Step 14/18 : RUN ./scripts/init_submodules.sh
 ---> Running in cea0d62781db
/bin/sh: 1: ./scripts/init_submodules.sh: not found
ERROR: Service 'prereqs' failed to build: The command '/bin/sh -c ./scripts/init_submodules.sh' returned a non-zero code: 127

@dery168
Copy link
Author

dery168 commented May 25, 2020

Here is my computer docker and OS info

Docker version 19.03.8, build afacb8b
PS C:\Users\deryy\grpc-web> docker --version
Docker version 19.03.8, build afacb8b
PS C:\Users\deryy\grpc-web> docker-compose -v

image

@stanley-cheung
Copy link
Collaborator

I really have no idea. Can you double check if you really have that file ./scripts/init_submodules.sh? That should be there.

@Mirmidon
Copy link

have same problem here
/bin/sh: 1: ./scripts/init_submodules.sh: not found
This file exists and have all rules needed for execution
any ideas how to solve this problem ?

@EmileMaras
Copy link

same issue for me
with
PS C:\plugins\gRPC\Tests\grpc-web> docker --version Docker version 19.03.8, build afacb8b PS C:\plugins\gRPC\Tests\grpc-web> docker-compose --version docker-compose version 1.25.5, build 8a1c60f6

Windows 10 Pro
Version 1909
OS build 18363.900

@EmileMaras
Copy link

It might help if, instead of doing docker pull, you can just do a docker build common prereqs node-server envoy commonjs-client, before you do docker-compose up -d node-server envoy commonjs-client. That will build those images using the latest code. That might get rid of some sort of version mismatch.

@stanley-cheung
That command
docker build common prereqs node-server envoy commonjs-client
does not work out. We get:
"docker build" requires exactly 1 argument.
@dery168 actually got the same issue (if you check the output he got)

@stanley-cheung
Copy link
Collaborator

@EmileMaras Sorry, typo, should be docker-compose build instead of docker build.

@EmileMaras
Copy link

Thanks @stanley-cheung
I actually got the same error but directly after launching the first command docker-compose build common prereqs node-server envoy commonjs-client
PS C:\plugins\gRPC\Tests\grpc-web> docker-compose build common prereqs node-server envoy commonjs-client Building common Step 1/8 : FROM node:10-stretch 10-stretch: Pulling from library/node 81fc19181915: Already exists ee49ee6a23d1: Already exists 828510924538: Already exists a8f58c4fcca0: Already exists 33699d7df21e: Already exists 923705ffa8f8: Already exists 667ab65c1289: Already exists 9c3f7667ed73: Already exists 03e9677c0489: Already exists Digest: sha256:f9e66964ec6e9a78693929b58b3d95aadf03cc70e47f6d276d1e0943853c2bb5 Status: Downloaded newer image for node:10-stretch ---> e7671d9424c2 Step 2/8 : RUN apt-get -qq update && apt-get -qq install -y unzip ---> Running in e4b12297601b Removing intermediate container e4b12297601b ---> d818c4c2f64e Step 3/8 : WORKDIR /tmp ---> Running in ce6c7b7dbf54 Removing intermediate container ce6c7b7dbf54 ---> ec4f113731c1 Step 4/8 : RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.2/protoc-3.12.2-linux-x86_64.zip -o protoc.zip && unzip -qq protoc.zip && cp ./bin/protoc /usr/local/bin/protoc ---> Running in 271fb3917db8 Removing intermediate container 271fb3917db8 ---> 44cc4919ab8d Step 5/8 : RUN curl -sSL https://github.com/grpc/grpc-web/releases/download/1.2.0/protoc-gen-grpc-web-1.2.0-linux-x86_64 -o /usr/local/bin/protoc-gen-grpc-web && chmod +x /usr/local/bin/protoc-gen-grpc-web ---> Running in c94fd7d4a06a Removing intermediate container c94fd7d4a06a ---> f536e4b5a1a3 Step 6/8 : WORKDIR /var/www/html/dist ---> Running in 3d3ac1b2f374 Removing intermediate container 3d3ac1b2f374 ---> 4de478fa1df2 Step 7/8 : WORKDIR /github/grpc-web ---> Running in f04b739e3cf6 Removing intermediate container f04b739e3cf6 ---> 0c321f38bf5c Step 8/8 : RUN git clone https://github.com/grpc/grpc-web . ---> Running in 5b54babfa605 Cloning into '.'... Removing intermediate container 5b54babfa605 ---> a2f5738dbd28 Successfully built a2f5738dbd28 Successfully tagged grpcweb/common:latest Building prereqs Step 1/18 : FROM grpcweb/common ---> a2f5738dbd28 Step 2/18 : ARG MAKEFLAGS=-j8 ---> Running in 0eecdc918f8b Removing intermediate container 0eecdc918f8b ---> de6badf1654b Step 3/18 : ARG BUILDIFIER_VERSION=1.0.0 ---> Running in a7e8fc9987e8 Removing intermediate container a7e8fc9987e8 ---> a7290589881f Step 4/18 : ARG BAZEL_VERSION=2.2.0 ---> Running in b5881905728d Removing intermediate container b5881905728d ---> 8c86a56882a4 Step 5/18 : RUN echo "\nloglevel=error\n" >> $HOME/.npmrc ---> Running in 68815e60f3ea Removing intermediate container 68815e60f3ea ---> a7cb94993c70 Step 6/18 : WORKDIR /github/grpc-web ---> Running in c98b553015f9 Removing intermediate container c98b553015f9 ---> 3e3d91978758 Step 7/18 : COPY ./Makefile ./Makefile ---> 618cf0bc6d71 Step 8/18 : COPY ./bazel ./bazel ---> 96261a843276 Step 9/18 : COPY ./javascript ./javascript ---> 8e9cdd2fb1d3 Step 10/18 : COPY ./net ./net ---> a9053adb31bd Step 11/18 : COPY ./packages ./packages ---> fe284c5e478f Step 12/18 : COPY ./scripts ./scripts ---> c7ed88fee58d Step 13/18 : COPY ./test ./test ---> cf744ad06b70 Step 14/18 : RUN ./scripts/init_submodules.sh ---> Running in f13f42f57dc5 /bin/sh: 1: ./scripts/init_submodules.sh: not found

@stanley-cheung
Copy link
Collaborator

@EmileMaras Can you check whether the file scripts/init_submodules.sh is executable?

@EmileMaras
Copy link

yes it is executable

@stanley-cheung
Copy link
Collaborator

Anybody have any idea here? I am really at a loss here.

@YuriyKrasilnikov
Copy link

YuriyKrasilnikov commented Jun 29, 2020

Maybe it is that bug? https://stackoverflow.com/questions/29045140/env-bash-r-no-such-file-or-directory

In dockerfile add sed $'s/\r$//' ./scripts/init_submodules.sh > ./scripts/init_submodules.sh

COPY ./test ./test
RUN sed $'s/\r$//' ./scripts/init_submodules.sh > ./scripts/init_submodules.sh
RUN ./scripts/init_submodules.sh

@dery168
Copy link
Author

dery168 commented Jun 30, 2020

Hi @YuriyKrasilnikov : You are right! I changed the \scripts\init_submodules.sh file format from CRLF to LF and the error mentioned above is gone!👍

However, Now new error encountered:
/usr/local/lib/node_modules/grpc-web -> /github/grpc-web/packages/grpc-web Removing intermediate container 49a2e3e3ceca ---> 5949bc5ab9b3 Step 16/18 : RUN wget -nv -O buildifier https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && chmod +x ./buildifier && ./buildifier --mode=check --lint=warn --warnings=all -r bazel javascript net && rm ./buildifier ---> Running in d5412f58b560 2020-06-28 02:12:53 URL:https://github-production-release-asset-2e65be.s3.amazonaws.com/60805080/9e71ee80-b5bb-11ea-88ed-6cdd343b7bf1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200630T031538Z&X-Amz-Expires=300&X-Amz-Signature=4a3769dec3fde991a3346e0df037ec603f244e088000d0d24851b3c286db416f&X-Amz-SignedHeaders=host&actor_id=0&repo_id=60805080&response-content-disposition=attachment%3B%20filename%3Dbuildifier&response-content-type=application%2Foctet-stream [4822842/4822842] -> "buildifier" [1] bazel/closure_grpc_web_library.bzl # reformat javascript/net/grpc/web/BUILD.bazel # reformat net/grpc/gateway/examples/echo/BUILD.bazel # reformat ERROR: Service 'prereqs' failed to build: The command '/bin/sh -c wget -nv -O buildifier https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && chmod +x ./buildifier && ./buildifier --mode=check --lint=warn --warnings=all -r bazel javascript net && rm ./buildifier' returned a non-zero code: 4

Updated \net\grpc\gateway\docker\prereqs\Dockerfile args BUILDIFIER_VERSION & BAZEL_VERSION to latest 3.3.0 still see the same error.

@daserge
Copy link

daserge commented Jul 14, 2020

The buildifier error could be caused by this change.
You can work around it via commenting out the corresponding RUN section in the net\grpc\gateway\docker\prereqs\Dockerfile

@dery168
Copy link
Author

dery168 commented Jul 15, 2020

Thank you so much @daserge !
Confirmed all working fine after commented out this line:
image

@teymur1986
Copy link

image

This doesn't help:
: COPY ./test ./test
---> 770eeea1eb72
Step 15/19 : RUN ./scripts/init_submodules.sh
---> Running in 925dd8ab1722
/bin/sh: 1: ./scripts/init_submodules.sh: not found
ERROR: Service 'prereqs' failed to build : The command '/bin/sh -c ./scripts/init_submodules.sh' returned a non-zero code: 127

@omen7288
Copy link

@TimorTartakovsky , you have to do either of the following (note, I had to do 2 to get fully working, see comments afterwards).

1: open up the init_submodules.sh and change line encoding to unix:

image

above example is in sublime text.

  1. change your git config to have autocrlf to false

git config --global core.autocrlf false

The error is misleading because it apparently has to do with line endings. I should state that I had issues with just doing 1. and hit a different error afterwards. I ended up changing my git config autocrlf to false, rechecked out the repo to a fresh copy and then I was able to get things fully to work though.

borissmidt pushed a commit to borissmidt/grpc-web that referenced this issue Feb 16, 2022
@grpc grpc deleted a comment from Snowwisair Jun 1, 2023
@grpc grpc deleted a comment from Snowwisair Jun 1, 2023
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

No branches or pull requests

8 participants