Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Truffle cannot migration with the latest Geth 1.8 #721

Closed
1 task done
hickscorp opened this issue Dec 15, 2017 · 53 comments
Closed
1 task done

Truffle cannot migration with the latest Geth 1.8 #721

hickscorp opened this issue Dec 15, 2017 · 53 comments

Comments

@hickscorp
Copy link

hickscorp commented Dec 15, 2017


Issue

When using the latest geth-unstable from the official debian ethereum repo (http://ppa.launchpad.net/ethereum/ethereum/ubuntu artful main), Truffle fails with even the most basic migrations.

It is worth noting that:

  • everything works fine with the geth package 1.7.3-stable.
  • you can observe the crash using the geth-unstable package 1.8.0-unstable.

Steps to Reproduce

Create the most simplistic project with only the Migration.sol contract and a migration to deploy it. Run truffle migrate --network geth, assuming that you configured a geth network somewhere in your truffle.js. Mine looks like so:

    geth: {
      host:       '127.0.0.1',
      port:       '7545',
      network_id: '1802',
      from:       '...'
    },

I'm using a set of scripts to get Geth to run correctly.

Expected Behavior

A successful migration with the last ID published.

Actual Results

Running migration: 20171201_010000_deploy_migrations.js
  Deploying Migrations...
  ... 0xc1dfca48204f704444a31539d83b53c1afc1baaf4e4f55352d31b8c406937178
  Migrations: 0x8cdaf0cd259887258bc13a92c0a6da92698644c0
Saving successful migration to network...
  ... 0x02b8ed4ab56dd0ae7656f99415f968fed333c20b22261193d18b5c07e2468b97
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: unknown transaction
    at Object.InvalidResponse (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:41484:16)
    at /home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:328866:36
    at /home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:176178:11
    at /home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:324536:9
    at XMLHttpRequest.request.onreadystatechange (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:327565:7)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:176407:18)
    at XMLHttpRequest._setReadyState (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:176697:12)
    at XMLHttpRequest._onHttpResponseEnd (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:176852:12)
    at IncomingMessage.<anonymous> (/home/doodloo/.nvm/versions/node/v8.9.1/lib/node_modules/truffle/build/cli.bundled.js:176812:24)
    at emitNone (events.js:111:20)

Environment

  • Operating System: Xubuntu 17.10.
  • Truffle version: 4.0.3, same issue with 4.0.1.
  • Ethereum client: See issue ticket.
  • node version: 8.9.1
  • npm version: 5.6.0
@yograterol
Copy link

I have the same issue. It happens when Truffle tries to get the recipient of the transaction.

@yograterol
Copy link

@yograterol
Copy link

I'm still having this issue.

@drootnar
Copy link

drootnar commented Jan 4, 2018

I have the same problem. My contracts don't change but now migrations don't work with above error. Do you have any update of this issue?

@hqxluoyang
Copy link

same issue , who can help me

@jsdu
Copy link

jsdu commented Jan 16, 2018

same issue, cant deploy my contracts to rinkeby network.
Truffle version 4.0.3, Geth Version: 1.8.0-unstable
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x23828749b08047265fcccff7481aae8b8fe81879639e7337dc2bd96ee48407dc
Migrations: 0xee57862b9c9216957fdff614c34ef94117a01449
Saving successful migration to network...
... 0x37a4f528dc8d31ec60cc4e420780dc7846771519949d17630a0b8516b36180de
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: unknown transaction
at Object.InvalidResponse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:41484:16)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:328866:36
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176178:11
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:324536:9
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:327565:7)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176407:18)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176697:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176852:12)
at IncomingMessage. (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:176812:24)
at emitNone (events.js:91:20)

@skozin
Copy link

skozin commented Jan 16, 2018

Having the same error inside our app when running on Rinkeby with Geth built from master.

@Artificial-Idiocy
Copy link

Having the same problem when deploying contracts to a private geth node built off 1.8.0-unstable. It fails after a response from the geth node.

What is interesting is that if I only deploy 1_initial_migration.js without any other follow-up migrations, no error occurs.

@jleeh
Copy link
Contributor

jleeh commented Jan 23, 2018

Having the exact same issue also on geth 1.8.0-unstable. Was rectified by using geth 1.7.3.

@ahester57
Copy link

ahester57 commented Jan 27, 2018

@hickscorp After trying lots of stuff, I got it past migration successfully by running miner.start() on the node that I am deploying the contract on. This seems to solve this issue.

@hickscorp
Copy link
Author

@ahester57 Being able to get past it with an active mining process is a bi-product of something else.
As I was suggesting in my original post, using geth 1.7.3 solves this issue. Hopefully this will be fixed before 1.8 gets out.

@ahester57
Copy link

@hickscorp This is actually on 1.7.3-stable as well. When deploying a newly initialized contract using truffle, it stalls right at the first migration, unless the node is mining.

@hickscorp
Copy link
Author

@ahester57 Well that's not new, and unrelated to the issue here. "Deploying" is just asking for data to be mined. I'd recommend you having a look at this tool. This is what we use to have "on-demand" mining local nodes with 0-difficulty, so our CPU just doesn't get busy non-stop.

@fabdarice
Copy link

seeing the same issue here

@marwand
Copy link

marwand commented Feb 15, 2018

Same issue here.
Issue exists with: geth-1.8.0-stable and truffle-4.0.6
Miner.start() does not solve the problem.

geth-1.7.3 works fine.

@hickscorp
Copy link
Author

I'd like to emphasize something here, what @ahester57 said about this problem being present on 1.7 is erroneous, it's a completelly different thing he's describing, not even an error (No transaction can be mined... Unless the node is mining). The 1.8 problem is indeed not solved by mining.

@darioAnongba
Copy link

Same issue while trying to deploy on Rinkeby testnet with:
geth-1.8.0-stable
truffle-4.0.6
What I don't understand is why is it working fine with Ganache and not with Rinkeby ?

@hickscorp
Copy link
Author

hickscorp commented Feb 15, 2018

@darioAnongba I think you might be confused here.

It works fine with Rinkeby. It just doesn't work with geth 1.8, those are two different things.

Your question might instead be "What I don't understand is why is it working fine with Ganache and not with Geth 1.8?", and the answer would be that Geth is just an implementation of Ethereum, while Ganache is another, and while Ganache returns something that Truffle expects during the migrations as well as Geth 1.7, Geth 1.8 doesn't.

Therefore, using Geth 1.7 you should get it to work regardless of the network you're deploying to.

@darioAnongba
Copy link

Thanks @hickscorp ! So if I understand correctly, Truffle is just not compatible with geth 1.8 yet.

@starlabs007
Copy link

I'm encountering this issue as well. I've installed a private blockchain using geth 1.8 and am also encountering the unknown transaction error.

Can this be given priority given 1.8 is now out? https://blog.ethereum.org/2018/02/14/geth-1-8-iceberg%C2%B9/

Some additional notes:

  • I've been using truffle 3.4.11 (hadn't upgraded to v4.x yet) and also encountered the unknown transaction, so it seems there is some relative old/stable code that does not work with geth 1.8.
  • Verified also occurs with truffle 4.0.6 against geth 1.8

@cgewecke
Copy link
Contributor

@hickscorp Thanks so much for all your work on this issue, much appreciated.
@starlabs007 Beginning investigation now. . .

@hickscorp
Copy link
Author

hickscorp commented Feb 16, 2018

@cgewecke Don't mention it. It's worth noting that I've started talking to the Geth devs, but I don't think it's a bug as per say, it's more likely a different behaviour that Truffle would have to accomodate for. Tell me if you need anything else.

I would say that this now might need a bit of attention from the devs, as @starlabs007 pointed out 1.8 has been out for a small while now.

Keep up the good work ;)

@cgewecke
Copy link
Contributor

truffle-contract 99 contains a small fix for this.

Not sure when our next patch release will be but should be resolved then.

@vecheslav
Copy link

https://github.com/ethereum/go-ethereum/releases/tag/v1.8.1
i think that nothing has changed?

@ericwooley
Copy link

ericwooley commented Feb 19, 2018

@vecheslav I just tested 1.8.1, still errored. Downgrading to 1.7.3 seems to be the way to go for now.

Here are some easy instructions for those who are desperate to deploy a contract. OSX only, though it would be similar on other OSs.

# OSX instructions to get 1.7.3
git clone [email protected]:ethereum/go-ethereum.git;
cd go-ethereum;
git checkout tags/v1.7.3; # checkout 1.7.3
# brew switch go 1.9.4; # install a version of go that 1.7.3 is happy with.
make geth;
ln -s ${PWD}/build/bin/geth /usr/local/bin/geth-173; # or geth if you want to use it in scripts etc...
geth-173 version; # version check

I had a hard time getting it to install with go 1.10 because make checks the version of go, and doesn't properly sort the versions. It things 1.10 < 1.7. So if make geth fails, you may have to run brew switch go 1.9.4 before make geth.

EDIT: forgot to checkout the right version in the script.

@ericwooley
Copy link

@cgewecke I'm not sure why this is closed? Was some progress made?

@virtonomics
Copy link

virtonomics commented Feb 20, 2018

You should checkout appropriate branch

git checkout origin/release/1.7

and compile this one

make

@andy-mcewan-artos-io
Copy link

I can deploy fine but any contracts method transactions fail. Rolled back to geth 1.7.3 fixed it.

@lerer00
Copy link

lerer00 commented Feb 22, 2018

Any plan to support new geth ^1.8? Or we need to rollback to ^1.7?

@cgewecke
Copy link
Contributor

@lerer00 There's a fix for this at truffle-contract 99 that should be released next Monday.

@lerer00
Copy link

lerer00 commented Feb 22, 2018

@cgewecke sweet thanks for the info.

@OfStone
Copy link

OfStone commented Feb 23, 2018

How to roll back to 1.7.3?

@ericwooley
Copy link

@OfStone #721 (comment)

@marshaln
Copy link

Pls suggest what is fix for this am also using Geth 1.8.1 and Truffle 4.0.6.
Contracts are deploying but .json file is not updated in build/contracts folder.

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: unknown transaction

@cgewecke cgewecke changed the title Truffle cannot migration with the latest Geth Unstable. Truffle cannot migration with the latest Geth 1.8 Feb 24, 2018
@JohnAllen
Copy link

JohnAllen commented Feb 24, 2018

@marshaln Downgrade to 1.7.3 and watch this issue for when it's fixed

@ahester57
Copy link

ahester57 commented Feb 24, 2018 via email

@JohnAllen
Copy link

@ahester57 If you're mining on Ropsten with a CPU it might take a while to migrate/mine a tx, right? Probably more than the timeout? Mining also used to not be necessary and is wasteful on testnets. So having to mine on a testnet instead of just connecting to a node to submit a tx or contracts seems to be a step backwards.

@ahester57
Copy link

@JohnAllen Downgrading is two steps backward, in my opinion.

@JohnAllen
Copy link

I'm sure they'll fix this, but not having to mine and run CPUs up (even with minerthreads 1) would be better. Wondering why they made this change!

@ericwooley
Copy link

You can't mine on rinkeby, which is a testnet I use often for simplicity. Ropsten is better, but it's more annoying also. I like to start with rinkeby.

@lerer00
Copy link

lerer00 commented Feb 25, 2018

@ahester57 There's a fix for this at truffle-contract 99 that should be released next Monday.

@cgewecke
Copy link
Contributor

4.0.7 is out and there's a confirmed success deploying with Geth 1.8 to Rinkeby from Gitter. There's also a confirmed 'having problems' on Ropsten. Feel free to report any developments here or on Gitter. We're also releasing tomorrow so if the current fix doesn't work, we'll have a chance to update it and try again shortly.

@cgewecke
Copy link
Contributor

@hickscorp Closing because we think this is fixed in 4.0.7. Thanks again, and please re-open if there's a problem.

pstehlik added a commit to centrifuge/pod that referenced this issue Mar 3, 2018
* working anchor prototype

* working anchor prototype

* testing out how to get the correct transaction ID from client to assure acceptance of data

* working 'integration test' setup with bindings from 1.7.3

* adding geth tooling scripts

* upgrading to go-ethereum 1.8 and testing

* adding go172 launch script as workaround for trufflesuite/truffle#721

* working 'integration test' to subscribe to logs/events

* working version with channel pass-through

* allowing to run eth commands from any directory

* faster block time for geth

* easier unit testing for anchoring. adding string tools.

* fix witness code to run tests

* more unit testing

* adding tests for tools package

* configuration for get_client coming from viper again

* anchor registry configurable through env vars

* support multiple eth accounts, start concurrency handling in eth client

* make eth client init thread safe

* clean up anchor creation safety, start concurrency handling

* add: comments, contextWaitTimeout as configuraton. fix: genesis file, mod: filter anchor registered event by "from" address
@cgewecke
Copy link
Contributor

cgewecke commented Mar 5, 2018

Small update: This is fixed at Geth as well as of 1.8.2 (released this morning). Geth no longer errors with 'unknown transaction'.

@ahester57
Copy link

ahester57 commented Mar 5, 2018 via email

@StDogbert
Copy link

Geth 1.8.1. Worked fine till yesterday. Error started appearing consistently for rinkeby and from time to time with ganache. Upgrade to 1.8.2 didn't fixed the issue.

@zulhfreelancer
Copy link

Upgraded my Truffle to 4.1.3 and it solved the problem (was on 4.0.6).

@swordfishwjy
Copy link

Just test Truffle 4.0.6 and Geth 1.8.2-stable. Deployment now works. @ahester57 Yes, also keep mining.😼

@imhari213
Copy link

Upgrading [email protected] to + [email protected] works for me 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests