tenderly-cli icon indicating copy to clipboard operation
tenderly-cli copied to clipboard

Couldn't read Truffle build files at: build/contracts

Open bigfootdeveloper opened this issue 4 years ago • 13 comments

When I run "truffle push" from truffle directory I get this error, but the directory build/contracts exists and the .json files are there.

# tenderly push --debug
Setting up your project...
Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
Trying hardhat ts config path: hardhat.config.ts
Trying brownie config path: brownie-config.yaml
Trying truffle config path: truffle-config.js
Analyzing Truffle configuration...
Trying truffle config path: /node/bigfoot-finance/contracts/truffle-config.js
Pushing Smart Contracts for project: bigfoot
unable to upload contracts: unable to get provider contracts: failed reading contract source file: open project:/contracts/bsc/BscMasterChef.sol: no such file or directory
Couldn't read Truffle build files at: build/contracts

bigfootdeveloper avatar Sep 21 '21 18:09 bigfootdeveloper

Hey! This usually happens if Truffle has old artifacts in the build folder. Does this still happen if you delete the build folder and try again after re-deploy?

P. S. It should also be sufficient to delete the BscMasterChef.json file and that's it.

BogdanHabic avatar Sep 22 '21 09:09 BogdanHabic

I deleted build directory and I did the complete compilation and migration.

But, it didn't work. Same error.

#tenderly push
Setting up your project...
Analyzing Truffle configuration...
Pushing Smart Contracts for project: bigfoot
Couldn't read Truffle build files at: build/contracts
root@bsctoken:/node/bigfoot-finance/contracts# tenderly push --debug
Setting up your project...
Trying OpenZeppelin config path: networks.js
couldn't read new OpenzeppelinConfig config file
Trying buidler config path: buidler.config.js
couldn't read new Buidler config file
Trying hardhat config path: hardhat.config.js
Trying hardhat ts config path: hardhat.config.ts
Trying brownie config path: brownie-config.yaml
Trying truffle config path: truffle-config.js
Analyzing Truffle configuration...
Trying truffle config path: /node/bigfoot-finance/contracts/truffle-config.js
Pushing Smart Contracts for project: bigfoot
unable to upload contracts: unable to get provider contracts: failed reading contract source file: open project:/contracts/bsc/BscBiswapVariables.sol: no such file or directory
Couldn't read Truffle build files at: build/contracts

May be that 'tenderly push' doesn't get relative path.

I am executing the order inside truffle directory, but the absolute path is /example/..../contracts.

May be a bug?

This is my folder structure

Screenshot

bigfootdeveloper avatar Sep 22 '21 12:09 bigfootdeveloper

Nothing about this?

bigfootdeveloper avatar Sep 24 '21 12:09 bigfootdeveloper

I'd need to look at the .json files. Is the project open source?

If not, I see two things we can do:

  • If you could upload the build folder here
  • Send us the project via the chat on our app

Bogdan

BogdanHabic avatar Sep 24 '21 15:09 BogdanHabic

Sorry, but it's a private repository.

I attached here the build folder, no problem.

build.zip

bigfootdeveloper avatar Sep 24 '21 17:09 bigfootdeveloper

@bigfootdeveloper just so you know, the build folder does contain source files, so you might want to delete this (I've downloaded it now).

BogdanHabic avatar Sep 27 '21 11:09 BogdanHabic

It's not a problem. The source code will be available when I will deploy the contracts, but the repo contains more info and that was the reason for do it private.

It would be important to find the reason for the failure. I think that tenderly it's a good tool, but work with truffle it's a "must have".

If you need something more, please, request it.

Thanks in advance.

bigfootdeveloper avatar Sep 27 '21 11:09 bigfootdeveloper

Nothing???

bigfootdeveloper avatar Oct 01 '21 23:10 bigfootdeveloper

Nothing yet?

bigfootdeveloper avatar Oct 06 '21 18:10 bigfootdeveloper

Hello! I have the same problem...

OS Linux 5.14.11-arch1-1 Truffle v5.4.1 (core: 5.4.1) Solidity - 0.8.6 (solc-js) Node v12.0.0 Web3.js v1.4.0

Debug log: image

Vorh avatar Oct 14 '21 19:10 Vorh

@BogdanHabic hi, can you help please? :(

Vorh avatar Oct 15 '21 16:10 Vorh

Clearly, it's a bug. The contracts are in the folder but tenderly-cli doesn't found it.

I have the same problem too. Look at the date of this issue.

certifirm avatar Oct 15 '21 16:10 certifirm

Hey guys, could you re-try this now? Pretty random issue, not sure why the legacy AST is generated at all (the regular ast doesn't have the import directives that cause the issue).

Malcador avatar Oct 25 '21 12:10 Malcador