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

Puppeth: Dockerfile Parse Error deploying sealer to network #16905

Closed
Swader opened this issue Jun 5, 2018 · 11 comments
Closed

Puppeth: Dockerfile Parse Error deploying sealer to network #16905

Swader opened this issue Jun 5, 2018 · 11 comments

Comments

@Swader
Copy link
Contributor

Swader commented Jun 5, 2018

When using Puppeth to deploy two sealer nodes to two different VMs on my subnet (Vagrant machines) one of which already holds a bootnode (successfully deployed), Puppeth fails to build a sealnode with the message Dockerfile Parse Error and the content:

Dockerfile parse error line 13: unknown instruction: "9A958F419E038F49D088A581006C298FACAF8B4667C61B23AACD33574062F05FBE034913BB27B2D8F3E1A2EA61CC1DE78DBAC876A536FA8F583ACE14B7AB6A5A@192.168.10.10:30303

This indicates that there's an interpolation error in the Dockerfile somewhere where the enode address of the bootnode is being given to Docker as a command, rather than escaped. I don't know how to find out which Dockerfile to check to fix this and send a PR.

I should note that up until recently (updated Virtualbox and Vagrant, and the base box) this same process worked fine, as described in this tutorial that is soon coming out on SitePoint.com: draft.

System information

Geth version: 1.8.10-stable
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.10.2
Operating System: darwin

Expected behaviour

Sealnode gets deployed as usual. No errors from Docker.

Actual behaviour

Error from Docker:

Dockerfile parse error line 13: unknown instruction: "9A958F419E038F49D088A581006C298FACAF8B4667C61B23AACD33574062F05FBE034913BB27B2D8F3E1A2EA61CC1DE78DBAC876A536FA8F583ACE14B7AB6A5A@192.168.10.10:30303

Steps to reproduce the behaviour

Follow the steps from this tutorial.

@Swader
Copy link
Contributor Author

Swader commented Jun 6, 2018

Having compiled the tools locally and disabled the cleanup operation post-deploy, I was able to retrieve the generated Dockerfile. It is indeed invalid due to an unsilenced warning being inserted before the enode address:

FROM ethereum/client-go:latest

ADD genesis.json /genesis.json

        ADD signer.json /signer.json
        ADD signer.pass /signer.pass

RUN \
  echo 'geth --cache 512 init /genesis.json' > geth.sh && \
        echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> geth.sh && \
        echo $'geth --networkid 60945 --cache 512 --port 30301 --maxpeers 50  --ethstats \'sealone:tns@192.168.10.10:8081\' --bootnodes enode://WARN [06-06|08:02:04] Sanitizing cache to Go's GC limits       provided=1024 updated=664
"14de96bf34c0c7952b580729e7a41019e88ce2f1a55797ed723390d104aa83088c1521b84e7a5325adf16974b75a3e77b7deb34b027576ae461adca1832bcbc2@192.168.10.10:30303  --unlock 0 --password /signer.pass --mine --targetgaslimit 4700000 --gasprice 18000000000' >> geth.sh

ENTRYPOINT ["/bin/sh", "geth.sh"]

@karalabe
Copy link
Member

karalabe commented Jun 6, 2018

Ah damn it, thanks for catching this.

@Christopher-Hayes
Copy link

This is a relief. First time using Puppeth, thought I was doing something wrong lol. Couldn't figure anything out until local compiling as well. Any ideas on how to fix this in the meantime? For now, I've hardcoded my bootnodes into the module_node.go file.

@Swader
Copy link
Contributor Author

Swader commented Jun 8, 2018

You can comment this line in module_go:

defer client.Run("rm -rf " + workdir)

This will keep the Dockerfile in place on the remote machine, letting you manually run it after you correct the bootnode address in the file. That way you can still dynamically generate the sealer nodes but you have manual step to actual run them.

I'm trying to figure out at which point this warning crops up so I can fix the problem but I'm not as familiar with go as I'd want to be so it's too easy to want to resort to simple string stripping which would be a hack. Hope to have more insight soon.

@Christopher-Hayes
Copy link

It looks like commit #16800 is causing the problem. I don't know Go, so I'm not sure how to resolve this. For now, removing the log warning on line 200 allows the sealers to correctly deploy.

Christopher-Hayes referenced this issue Jun 8, 2018
cmd: cap cache size if exceeds reasonable range
@Swader
Copy link
Contributor Author

Swader commented Jun 10, 2018

@Christopher-Hayes this fix didn't do it for me because I'd need to rebuild the geth in destination servers too it seems. Currently easier to remove deletion or strip the string in the Puppeth implementation.

@Swader
Copy link
Contributor Author

Swader commented Jun 15, 2018

Days later, I couldn't get through dependency hell and find out where this first occurs. If I debug w.conf.bootnodes at L86 of wizard_intro.go, it'll produce an empty array. If I check in wizard_node.go right after the deployNode function opens, the error is already there in bootnodes. It's as if somewhere in between it tries to read bootnodes specifically and gets that warning as output, prepending the bootnode address with it, and I'm at a loss as to where this happens. I think I'll have to throw in the towel and defer to @karalabe

@Swader
Copy link
Contributor Author

Swader commented Jun 16, 2018

Disabling the logger with DiscardHandler in module_node.go on line 221 also does not help, but that's where this problem occurs. In fact, it's the line which executes docker exec %s_%s_1 geth --exec admin.nodeInfo.id attach that produces this result in the terminal. If you test this directly where the node is running, it appears in the output of the terminal:

screenshot 2018-06-16 15 16 23

This is why the disabling of the logger had no effect, since the warning occurs where geth is running, not where it's launched from.

I'll get to the bottom of this and solve it without string stripping if it kills me.

Swader added a commit to Swader/go-ethereum that referenced this issue Jun 16, 2018
This change solves issue ethereum#16905 by disabling log output when asking for enode address from a deployed node.
@Swader
Copy link
Contributor Author

Swader commented Jun 16, 2018

Got it.
This was a fun exploration of Go and Geth in general.

@athenawisdoms
Copy link

Is there an earlier version of ethereum that we can compile from that will avoid this problem

Dockerfile parse error line 13: unknown instruction: ...

@vertangelx
Copy link

@Swader I commented our that file as suggested and edited the Dockerfile to remove the error message.

How do I run the Dockerfile? Sorry I am new to docker

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

No branches or pull requests

5 participants