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

No such file or directory (os error 2) #4

Open
gespi1 opened this issue Apr 27, 2022 · 1 comment
Open

No such file or directory (os error 2) #4

gespi1 opened this issue Apr 27, 2022 · 1 comment

Comments

@gespi1
Copy link

gespi1 commented Apr 27, 2022

dfx version: 0.9.3
laptop: mac M1 (12.3.1)

while using the fleekhq ic-deploy action on my ICP project. I kept encountering the following error No such file or directory (os error 2) as shown in the image below;

Screen Shot 2022-04-26 at 8 01 24 PM

my deploy.yaml looked just like the current README on this project;

on: [push]

jobs:
  test-deploy:
    runs-on: ubuntu-latest
    name: A job to deploy canisters to the IC
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        run: npm install
      - name: Deploy canisters
        id: deploy
        uses: fleekhq/ic-deploy-action@master
        with:
          identity: ${{ secrets.DFX_IDENTITY }}
          wallets: ${{ secrets.DFX_WALLETS }}
      - name: Show success message
        run: echo success!

Verified my canister source paths were correct, and the dist folder and .dfx folders existed.

So i decided to fork this repo and try replicating the issue locally to find out whats going on.

When trying to replicate it locally, I ran into a different error upon getting to the dfx deploy part, The command '"npm" "run" "build"' failed with exit status 'exit status: 127'..

Screen Shot 2022-04-26 at 8 33 09 PM

It wasn't until i added npm and rsync on the image that i was able to deploy it to IC from my local.
Below is the modified Dockerfile I used.

# switched from aarch to amd64 bc mac m1 was giving me issues about that arch type
FROM amd64/ubuntu:focal

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH="/home/node/.npm-global/bin:$PATH"
ENV DEBIAN_FRONTEND=noninteractive                     # used to have npm install non-interactive

USER node

COPY dfx-install.sh /home/dfx-install.sh
COPY entrypoint.sh /home/node/entrypoint.sh

USER root

RUN apt-get update && apt-get install -y curl \
  build-essential \
  libc6-dev \
  rsync \
  npm

RUN ["chmod", "+x", "/home/dfx-install.sh"]

RUN ["sh", "-m", "/home/dfx-install.sh"]

RUN ["chmod", "+x", "/home/node/entrypoint.sh"]

ENTRYPOINT ["/home/node/entrypoint.sh"]

Then i added my fork as apart of my github action

on: [push]

jobs:
  test-deploy:
    runs-on: ubuntu-latest
    name: A job to deploy canisters to the IC
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        run: npm install
      - name: Deploy canisters
        id: deploy
        uses: gespi1/ic-deploy-action@master
        with:
          identity: ${{ secrets.DFX_IDENTITY }}
          wallets: ${{ secrets.DFX_WALLETS }}
      - name: Show success message
        run: echo success!

and WAH-LA the error I was getting originally is gone.
Seems like having npm and rsync installed as part of the Dockerfile solved my issue.

Not certain of the root cause and if others are having the same issue but if you are here ya go.

@gespi1
Copy link
Author

gespi1 commented Apr 27, 2022

opened PR #5

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

1 participant