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

dfx deploy --network=ic failure on a newly created project #3870

Open
ninegua opened this issue Aug 10, 2024 · 5 comments
Open

dfx deploy --network=ic failure on a newly created project #3870

ninegua opened this issue Aug 10, 2024 · 5 comments
Labels
needs-triage This ticket needs investigation.

Comments

@ninegua
Copy link
Member

ninegua commented Aug 10, 2024

I tried the following:

  1. dfx new --frontend vanilla hello
  2. dfx deploy --network=ic

I expected it to successfully deploy both backend and frontend canisters.

Instead, this happened:

WARN: The default identity is not stored securely. Do not use it to control a lot of cycles/ICP. Create a new identity with `dfx identity new` and use it in mainnet-facing comm
ands with the `--identity` flag
Deploying all canisters.
Creating canisters...
Creating canister hello_backend...
hello_backend canister created on network ic with canister id: mnqht-aaaaa-aaaal-qjpaq-cai
Creating canister hello_frontend...
hello_frontend canister created on network ic with canister id: metmp-wiaaa-aaaal-qjpba-cai
Building canisters...
Building frontend...
Error: Failed while trying to deploy canisters.
Caused by: Failed to build all canisters.
Caused by: Failed while trying to build all canisters.
Caused by: The post-build step failed for canister 'metmp-wiaaa-aaaal-qjpba-cai' (hello_frontend)
Caused by: Failed to build frontend for network 'ic'.
Caused by: The command 'cd "/Users/paul/hello" && CANISTER_CANDID_PATH="/Users/paul/hello/.dfx/ic/canisters/hello_frontend/assetstorage.did" CANISTER_CANDID_PATH_HELLO_BACKEND=
"/Users/paul/hello/.dfx/ic/canisters/hello_backend/hello_backend.did" CANISTER_ID="metmp-wiaaa-aaaal-qjpba-cai" CANISTER_ID_HELLO_BACKEND="mnqht-aaaaa-aaaal-qjpaq-cai" CANISTER
_ID_HELLO_FRONTEND="metmp-wiaaa-aaaal-qjpba-cai" DFX_NETWORK="ic" DFX_VERSION="0.22.0" NODE_ENV="production" "npm" "run" "build" "--workspace" "hello_frontend"' failed with exi
t status 'exit status: 1'.
Stdout:

> [email protected] prebuild
> dfx generate


Stderr:
Building canisters before generate for Motoko
WARN: .did file for canister 'hello_frontend' does not exist.
Generating type declarations for canister hello_frontend:
Error: Failed while trying to generate type declarations for 'hello_frontend'.
Caused by: Candid file: /Users/paul/hello/.dfx/local/canisters/hello_frontend/assetstorage.did doesn't exist.
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: [email protected]
npm ERR!   at location: /Users/paul/hello/src/hello_frontend

Meta

dfx --version:

dfx 0.22.0
@ninegua ninegua added the needs-triage This ticket needs investigation. label Aug 10, 2024
@ninegua
Copy link
Member Author

ninegua commented Aug 10, 2024

It looks like dfx was looking for a did file from local build

Candid file: /Users/paul/hello/.dfx/local/canisters/hello_frontend/assetstorage.did doesn't exist.

If I start replica and deploy locally first, then deploy to ic works as expected.

@KereyWatters
Copy link

We're running into this when trying to deploy to mainnet too.
As part of our deployment step, I'm spinning up and running a local deploy first to generate the files, before doing a --ic deploy

@alisovoy
Copy link

Hello,

but this looks like a workaround...

I have the same problem but with deploying to the playground. It's looking for a did file from the local build, not from the 'playground' (or 'ic' in your case) folder where all files are.

@alisovoy
Copy link

Apparently, the issue is fixed here: #3987
The version 0.24.2 works as expected (tested only with playground)

@vincentes
Copy link

vincentes commented Nov 29, 2024

Man, these types of errors should be fixed and tested for. These small confusing bugs make development a lot slower and tedious. Imagine a new guy running into this when finding out about IC. They are not coming back.

Anyway, I have this error when deploying to the local network using 0.24.2 and also 0.20.1

Fixed by downloading the assetstorage.did before running dfx build.

https://github.com/keygate-vault/multisignature/actions/runs/12090187932/workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This ticket needs investigation.
Projects
None yet
Development

No branches or pull requests

4 participants