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

Exception has occurred: Error: ENOENT: no such file or directory #4832

Closed
sudeepdino008 opened this issue Feb 8, 2024 · 2 comments
Closed
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@sudeepdino008
Copy link

sudeepdino008 commented Feb 8, 2024

Version of Hardhat

2.10.1

What happened?

I'm getting the following error on all tests in my project when running npx hardhat test <testfile>

TypeError: Cannot read properties of undefined (reading 'type')
      at remoteReceiptToRpcReceiptOutput (node_modules/hardhat/src/internal/hardhat-network/provider/output.ts:357:33)
      at ForkBlockchain._processRemoteReceipt (node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts:346:52)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at ForkBlockchain.getTransactionReceipt (node_modules/hardhat/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts:185:23)
      at HardhatNode.getTransactionReceipt (node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:937:21)
      at EthModule._getTransactionReceiptAction (node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:860:21)
      at HardhatNetworkProvider.request (node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:118:18)
      at EGRDataCollectionProvider.request (node_modules/hardhat-gas-reporter/src/providers.ts:30:28)
      at validateStoredDeployment (node_modules/@openzeppelin/upgrades-core/src/deployment.ts:113:16)
      at validateCached (node_modules/@openzeppelin/upgrades-core/src/deployment.ts:85:7)

I tried to set the "Caught Exceptions" breakpoint in visual code, and got the exception:

Exception has occurred: Error: ENOENT: no such file or directory, open '/Users/sudeep/repos/cqt-staking/cache/hardhat-network-fork/network-1/request-d4f378bdf1c533956333903f4cdaa2fe.json'

the stack being:

arguments.<computed> (/Users/sudeep/repos/cqt-staking/node_modules/universalify/index.js:9)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/jsonfile/index.js:27)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/graceful-fs/graceful-fs.js:123)
FSReqCallback.readFileAfterOpen (fs:317)
FSReqCallback.callbackTrampoline (internal/async_hooks:130)
FSREQCALLBACK (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
readFile (fs:404)
go$readFile (/Users/sudeep/repos/cqt-staking/node_modules/graceful-fs/graceful-fs.js:118)
readFile (/Users/sudeep/repos/cqt-staking/node_modules/graceful-fs/graceful-fs.js:115)
readFile (/Users/sudeep/repos/cqt-staking/node_modules/jsonfile/index.js:26)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/universalify/index.js:13)
readFile (/Users/sudeep/repos/cqt-staking/node_modules/universalify/index.js:7)
_getRawFromDiskCache (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/jsonrpc/client.js:270)
_getFromDiskCache (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/jsonrpc/client.js:256)
_perform (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/jsonrpc/client.js:154)
getTransactionByHash (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/jsonrpc/client.js:74)
getTransaction (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/fork/ForkBlockchain.js:93)
_processRemoteReceipt (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/fork/ForkBlockchain.js:230)
getTransactionReceipt (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/fork/ForkBlockchain.js:117)
await (Unknown Source:0)
getTransactionReceipt (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/node.js:535)
_getTransactionReceiptAction (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/modules/eth.js:466)
processRequest (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/modules/eth.js:110)
_send (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/provider.js:136)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
request (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/hardhat-network/provider/provider.js:77)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
request (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/providers/accounts.js:228)
request (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/providers/gas-providers.js:22)
request (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/providers/backwards-compatibility.js:26)
request (/Users/sudeep/repos/cqt-staking/node_modules/hardhat-gas-reporter/dist/src/providers.js:28)
send (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/providers/backwards-compatibility.js:29)
getTransactionByHash (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/provider.js:47)
validateStoredDeployment (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/deployment.js:71)
validateCached (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/deployment.js:48)
resumeOrDeploy (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/deployment.js:34)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/impl-store.js:35)
await (Unknown Source:0)
lockedRun (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/manifest.js:138)
await (Unknown Source:0)
fetchOrDeployGeneric (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/impl-store.js:27)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
fetchOrDeployGetDeployment (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/upgrades-core/dist/impl-store.js:85)
deployImpl (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/hardhat-upgrades/dist/utils/deploy-impl.js:41)
deployProxyImpl (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/hardhat-upgrades/dist/utils/deploy-impl.js:30)
await (Unknown Source:0)
deployProxy (/Users/sudeep/repos/cqt-staking/node_modules/@openzeppelin/hardhat-upgrades/dist/deploy-proxy.js:14)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
deployUpgradeableContract (/Users/sudeep/repos/cqt-staking/test/fixtures.js:203)
await (Unknown Source:0)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
deployStaking (/Users/sudeep/repos/cqt-staking/test/fixtures.js:208)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
getAllWithCoolDown (/Users/sudeep/repos/cqt-staking/test/fixtures.js:168)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
<anonymous> (/Users/sudeep/repos/cqt-staking/test/cqt-staking/unit-tests/transferUnstakedOut2.js:88)
callFn (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runnable.js:366)
Runnable.run (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runnable.js:354)
Runner.runTest (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:666)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:789)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:581)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:591)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:474)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:559)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
Runner.hook (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:558)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:584)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:591)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:474)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:559)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
Runner.hook (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:558)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:584)
Runner.hooks (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:595)
Runner.hookDown (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:619)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:767)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:746)
Runner.runTests (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:830)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:907)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:474)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:559)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
Runner.hook (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:558)
Runner.runSuite (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:903)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:881)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:880)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:728)
Runner.runTests (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:830)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:907)
next (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:474)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:559)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
Runner.hook (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:558)
Runner.runSuite (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:903)
begin (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:1046)
prepare (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:1062)
processImmediate (internal/timers:478)
callbackTrampoline (internal/async_hooks:130)
Immediate (Unknown Source:0)
init (internal/inspector_async_hook:25)
emitInitNative (internal/async_hooks:202)
emitInitScript (internal/async_hooks:505)
initAsyncResource (internal/timers:160)
Immediate (internal/timers:624)
setImmediate (timers:306)
Runner.run (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:1091)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:1134)
runAsync (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/runner.js:1133)
runAsync (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/mocha.js:1018)
Mocha.run (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/node_modules/mocha/lib/mocha.js:1033)
testFailures (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/builtin-tasks/test.js:78)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/builtin-tasks/test.js:77)
await (Unknown Source:0)
_runTaskDefinition (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:136)
runSuperFunction (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:118)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat-gas-reporter/dist/src/index.js:174)
await (Unknown Source:0)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
processTicksAndRejections (internal/process/task_queues:95)
await (Unknown Source:0)
_runTaskDefinition (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:136)
Environment.run (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:53)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/builtin-tasks/test.js:103)
await (Unknown Source:0)
_runTaskDefinition (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:136)
Environment.run (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/core/runtime-environment.js:53)
main (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/cli/cli.js:171)
await (Unknown Source:0)
<anonymous> (/Users/sudeep/repos/cqt-staking/node_modules/hardhat/internal/cli/cli.js:232)
Module._compile (internal/modules/cjs/loader:1233)
Module._extensions..js (internal/modules/cjs/loader:1287)
Module.load (internal/modules/cjs/loader:1091)
Module._load (internal/modules/cjs/loader:938)
executeUserEntryPoint (internal/modules/run_main:83)
<anonymous> (internal/main/run_main_module:23)

So the tx call from tests is trying to search in local cache, but not finding it there and giving out "no such file or directory". I tried removing the cache directory and retrying, same issue.

The search in local FS cache fails and then attempt is made to the http provider. But the request shouldn't ever go to http provider, right? It should all be handled in local filesystem itself.

Minimal reproduction steps

It's not reproducible. When I create a new clone of my project, the error is no more there. But after a while it comes back.

Search terms

No response

@schaable
Copy link
Member

schaable commented Feb 8, 2024

This will be hard to diagnose without a way to reproduce it and without knowing more about the setup. We can take a look if you can give us access to the repo. Otherwise, we'll need an example repo with the error.

@schaable schaable added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Feb 8, 2024
@schaable
Copy link
Member

schaable commented Mar 1, 2024

Closing for lack of response. Feel free to reopen if you can provide more info.

@schaable schaable closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Mar 1, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Archived in project
Development

No branches or pull requests

2 participants