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

zksync-cli dev start command failed to build the Docker image due to a bug in the zkcli-in-memory-node Dockerfile #130

Open
0x-stan opened this issue Mar 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@0x-stan
Copy link
Contributor

0x-stan commented Mar 22, 2024

🐛 Bug Report for zkSync CLI

📝 Description

zksync-cli dev start command failed to build the docker image due to a bug in the zkcli-in-memory-node Dockerfile. I have submitted a PR to the zkcli-in-memory-node repo to fix this issue.

matter-labs/zkcli-in-memory-node#3

Using curl -s echo may cause the jq -r command to fail, but removing the echo command allows it to execute correctly. The current version of the Dockerfile will cause the build to fail; after modification, it can be built successfully.

# query faild with echo
curl -s echo "https://api.github.com/repos/matter-labs/era-test-node/releases/tags/v0.1.0-alpha.19" | jq -r
jq: parse error: Invalid numeric literal at line 1, column 10

# query successfully without echo
curl -s "https://api.github.com/repos/matter-labs/era-test-node/releases/tags/v0.1.0-alpha.19" | jq -r
{
  "url": "https://api.github.com/repos/matter-labs/era-test-node/releases/147603455",
  "assets_url": "https://api.github.com/repos/matter-labs/era-test-node/releases/147603455/assets",
  "upload_url": "https://uploads.github.com/repos/matter-labs/era-test-node/releases/147603455/assets{?name,label}",
  ...
}

🔄 Reproduction Steps

  1. npx zksync-cli dev start

🤔 Expected Behavior

npx zksync-cli dev start command execute successfully.

😯 Current Behavior

npx zksync-cli dev start command execute faild.

🖥️ Environment

  • Operating System: macOs Ventura 13.3
  • Node.js Version: 20.11.0
  • npm Version: 10.5.0
  • Docker Version: 24.0.2
  • curl Version: 7.87.0
  • jq Version: jq-1.7.1

📋 Additional Context

📎 Log Output

image
> npx zksync-cli dev start

Installing "In memory node"...
[+] Building 3.5s (10/11)                                                                                                                       
 => [zksync internal] load build definition from Dockerfile                                                                                0.0s
 => => transferring dockerfile: 787B                                                                                                       0.0s
 => [zksync internal] load .dockerignore                                                                                                   0.0s
 => => transferring context: 2B                                                                                                            0.0s
 => [zksync internal] load metadata for docker.io/library/ubuntu:latest                                                                    3.2s
 => [zksync auth] library/ubuntu:pull token for registry-1.docker.io                                                                       0.0s
 => [zksync 1/7] FROM docker.io/library/ubuntu:latest@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e              0.0s
 => CACHED [zksync 2/7] WORKDIR /app                                                                                                       0.0s
 => CACHED [zksync 3/7] RUN apt-get update   && apt-get install -y curl jq   && apt-get clean   && rm -rf /var/lib/apt/lists/*             0.0s
 => CACHED [zksync 4/7] RUN echo "In memory node version: v0.1.0-alpha.19"                                                                 0.0s
 => CACHED [zksync 5/7] RUN curl -s echo "https://api.github.com/repos/matter-labs/era-test-node/releases/tags/v0.1.0-alpha.19" |   jq -r  0.0s
 => ERROR [zksync 6/7] RUN tar xz -f era_test_node.tar.gz -C /usr/local/bin/                                                               0.2s
------
 > [zksync 6/7] RUN tar xz -f era_test_node.tar.gz -C /usr/local/bin/:
#0 0.208 tar (child): era_test_node.tar.gz: Cannot open: No such file or directory
#0 0.208 tar (child): Error is not recoverable: exiting now
#0 0.210 tar: Child returned status 2
#0 0.211 tar: Error is not recoverable: exiting now
------
failed to solve: process "/bin/sh -c tar xz -f era_test_node.tar.gz -C /usr/local/bin/" did not complete successfully: exit code: 2
ⓘ There was an error while starting the testing environment:
ⓘ Command exited with code 17: 
file:///Users/stan/.npm/_npx/ed2d5270b29717fa/node_modules/zksync-cli/bin/utils/helpers.js:52
                reject(new Error(`Command exited with code ${code}: ${errorOutput}`));
                       ^

Error: Command exited with code 17: 
    at ChildProcess.<anonymous> (file:///Users/stan/.npm/_npx/ed2d5270b29717fa/node_modules/zksync-cli/bin/utils/helpers.js:52:24)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  level: 'error',
  [Symbol(level)]: 'error',
  [Symbol(message)]: '\x1B[91mⓘ Command exited with code 17: \x1B[39m'
}

Node.js v20.11.0
@0x-stan 0x-stan added the bug Something isn't working label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant