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

BE fails to spin up using zksync-cli dev start due to permissions #16

Open
dutterbutter opened this issue Sep 23, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@dutterbutter
Copy link
Contributor

🐛 Bug Report for Block Explorer zkcli module

📝 Description

When using zksync-cli to spin up a local block explorer it frequently errors due to permissions.

Provide a clear and concise description of the bug.

🔄 Reproduction Steps

Steps to Reproduce

  1. Install zkSync CLI using Bunx

    Run the following command to install or update the zkSync CLI:

    bunx zksync-cli@latest dev config
  2. Select Node Type and Enable Block Explorer

    Follow the on-screen prompts to configure your environment:

    • Choose your preferred node type (e.g., Dockerized setup).
    • Ensure that you select Block Explorer as part of the setup.
  3. Start the zkSync Development Environment

    Once configuration is complete, run the following command to start the environment:

    bunx zksync-cli@latest dev start
  4. Observe the Error

    When starting the environment, you will encounter the following error related to file permissions during the installation of Block Explorer:

    Installing "Block Explorer"...
     There was an error while starting the testing environment:
     EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'
    node:fs:2969
      handleErrorFromBinding(ctx);
      ^
    
    Error: EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'
        at Object.copyFileSync (node:fs:2969:3)
        at SetupModule.install (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/dist/index.js:96:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async installModules (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zksync-cli/bin/commands/dev/start.js:17:9)
        at async Command.handler (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zksync-cli/bin/commands/dev/start.js:149:9) {
      errno: -13,
      syscall: 'copyfile',
      code: 'EACCES',
      path: '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml',
      dest: '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml',
      level: 'error',
      [Symbol(level)]: 'error',
      [Symbol(message)]: "\\x1B[91mⓘ EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'\\x1B[39m"
    }
    
    Node.js v18.17.0

🤔 Expected Behavior

For the block explorer to start up with no issues.

😯 Current Behavior

Errors with permissions issue:

    Installing "Block Explorer"...
    ⓘ There was an error while starting the testing environment:
    ⓘ EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'
    node:fs:2969
      handleErrorFromBinding(ctx);
      ^
    
    Error: EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'
        at Object.copyFileSync (node:fs:2969:3)
        at SetupModule.install (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/dist/index.js:96:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async installModules (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zksync-cli/bin/commands/dev/start.js:17:9)
        at async Command.handler (file:///private/tmp/bunx-501-zksync-cli@latest/node_modules/zksync-cli/bin/commands/dev/start.js:149:9) {
      errno: -13,
      syscall: 'copyfile',
      code: 'EACCES',
      path: '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml',
      dest: '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml',
      level: 'error',
      [Symbol(level)]: 'error',
      [Symbol(message)]: "\\x1B[91mⓘ EACCES: permission denied, copyfile '/private/tmp/bunx-501-zksync-cli@latest/node_modules/zkcli-block-explorer/docker-compose.yml' -> '/Users/dustinbrickwood/.local/state/zksync-cli/modules/zkcli-block-explorer/docker-compose.yml'\\x1B[39m"
    }
    
    Node.js v18.17.0

🖥️ Environment

  • Package version: 1.10.1 (zksync-cli)
  • Node version: v18.17.0
  • NPM/Yarn version: 1.22.22
  • Operating System & Version: Macos
  • Other relevant environment details:

📋 Additional Context

📎 Log Output

Paste any relevant log output here.
@dutterbutter dutterbutter added the bug Something isn't working label Sep 23, 2024
@dutterbutter
Copy link
Contributor Author

Had to adjust permissions locally by running sudo chown -R $(whoami) on the issued path.

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