trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

Error: *** Deployment Failed *** "Migrations" -- invalid sender. #3936

Closed Srulik-p closed 3 years ago

Srulik-p commented 3 years ago

Issue

Getting this - Error: Deployment Failed "Migrations" -- invalid sender.

when trying to deploy to Ropsten Network

Steps to Reproduce truffle migrate --network ropsten

Actual Results

Error: Deployment Failed

"Migrations" -- invalid sender.

Environment

Windows Truffle v5.2.4

kdeasymoneysniper commented 3 years ago

i am facing the same issue but on the bsc testnet! have u managed to solve it yet?

connerdavis47 commented 3 years ago

I'm having the same issue. I'm coming from Mastering Ethereum with minimal experience but pretty confident the setup is correct. I can deploy contracts using truffle develop and I can also see that HDWalletProvider returns my ropsten account. I am using a private key but also tried mnemonic to no luck.

Edit: truffle console still produces the same result for me.

AudioLeaf commented 3 years ago

Having the same issue from attempt to deploy to ropsten using basic contract. Works fine on ganache.

shoenseiwaso commented 3 years ago

Possible dupe of #3935, #3913

DeFiYaco commented 3 years ago

I don't think it is duplicate. https://github.com/trufflesuite/truffle/issues/3913 and https://github.com/trufflesuite/truffle/issues/3935 were possibly fixed with 5.2.5 and this is not. At least it does not work for me when trying to deploy using infura or alchemy.

shoenseiwaso commented 3 years ago

I don't think it is duplicate. #3913 and #3935 were possibly fixed with 5.2.5 and this is not. At least it does not work for me when trying to deploy using infura or alchemy.

3913 and #3935 were definitely not fixed with 5.2.5, which only updated the contract interaction module and not the deployer module. I think all three of these issues are about this deployer module.

trapped commented 3 years ago

I'm getting this same error when trying to migrate. Using truffle console works though.

jerrkill commented 3 years ago

Obviously it is caused by hdwallet-provider, just switch hdwallet-provider back to 1.2.2. It looks like below

...
"@truffle/hdwallet-provider": "1.2.2",
...
wrightkhlebisol commented 3 years ago

@jerrkill's solution fixed it for me, although it does not make sense that I need to downgrade to use it

shoenseiwaso commented 3 years ago

This worked for us as well on one pre-Berlin local blockchain.

linxux commented 3 years ago

Meet the similar issue. And seems works when downgrade the version of hdwallet-provider back to 1.2.2.

BlackienBad commented 3 years ago

downgrading worked for me too

TobyKreiselmaier commented 3 years ago

Downgrade worked for me too.

gabmontes commented 3 years ago

It looks like a change in hdwallet-provider@1.2.4 broke several things. See:

https://github.com/trufflesuite/truffle/issues/3946#issuecomment-809713559

eggplantzzz commented 3 years ago

I think the upgrade to a newer version of a dep in @truffle/hdwallet-provider is causing this problem. I'll see if I can put in a fix for this week's release! Version 1.2.3 seems to work fine for me while performing simple migrations. Thanks everyone for reporting!

raphaelspak commented 3 years ago

Downgrade also worked for me.

haltman-at commented 3 years ago

OK, this should be resolved in 5.3.0, so I'm going to close this. Let us know if it's not and we can reopen.

Morinohtar commented 3 years ago

Had the same problem now after upgrading Truffle (cant remember exactly the version i had before, but some 5.3.x) and some other packages (including hdwallet-provider). And it resolved by downgrading hdwallet-provider from v1.2.6 to v1.2.3.

Stuff installed and running that didnt work:

Truffle v5.3.4 (core: 5.3.4)
Solidity - 0.8.4 (solc-js)
Node v14.16.0
Npm v7.7.4
Web3.js v1.3.5
hdwallet-provider v1.2.6

Changed hdwallet-provider to v1.2.3 (like some of the suggestions) and puff, it worked.

samuelecisaro commented 3 years ago

Same problem, but downgrading to hdwallet-provider v1.2.3 it works. Thanks.

nehal-backspace commented 3 years ago

Other Solution

Inside truffle-config.js use :

const HDWalletProvider = require('truffle-hdwallet-provider');

instead of

const HDWalletProvider = require('@truffle/hdwallet-provider');

It's just other way of downgrading the @truffle/hdwallet-provider

while your package.json can still have "dependencies": { "@truffle/hdwallet-provider": "^1.3.1" }

neelriyer commented 3 years ago

@nehal-backspace this is the only thing that worked for me. Thanks

Git-Leon commented 3 years ago

I have tried each of the aforementioned suggestions to no prevail in BSC MainNet. I have had success in BSC TestNet as well as Ropsten TestNet. However, the issue resurfaces when attempting to execute truffle deploy --network bsc with the truffle-config.js pointing its providerOrUrl to https://bsc-dataseed.binance.org (I have also attempted https://bsc-dataseed1.binance.org). For reference I am using my metamask wallet which is configured for the binance smart chain network. I have also attempted to use several different versions of the HDWalletProvider.

1.0.18 1.2.2 - suggested by @jerrkill 1.2.3 - suggested by @eggplantzzz 1.2.6 1.3.1

As suggested by @nehal-backspace, I have also attempted to change truffle-config's const HDWalletProvider from

const HDWalletProvider = require('@truffle/hdwallet-provider');

to

const HDWalletProvider = require('truffle-hdwallet-provider');

However, for each of the versions mentioned above, truffle was unable to fetch the package.

Does anyone have any other suggestions?

Morinohtar commented 3 years ago

Well, with v1.4 the issue is gone and i stopped having the problem... back to normal :)