Musicoin / desktop

The official Musicoin Desktop Wallet Application
https://musicoin.org
Other
115 stars 67 forks source link

Failed to start child process gmc #123

Closed dimhoff closed 6 years ago

dimhoff commented 6 years ago

Hi,

I downloaded the 0.8 release for Linux. Running ./Musicoin-wallet from the Musicoin-wallet-linux-x64/ directory gives me a splash screen saying it is syncing, but percentage says at 0%.

In the terminal I see the following log:

ATTENTION: default value of option force_s3tc_enable overridden by environment.
process.platform: linux
process.env.APPDATA: undefined
process.env.HOME: /home/musicoin
Initializing command: {"name":"Musicoin Wallet","path":"{process.cwd}/bin/gmc/","command":"./gmc","args":["--rpc","--rpcapi=admin,db,eth,net,web3,personal,miner","--rpcport","8545","--rpcaddr","127.0.0.1","--rpccorsdomain","localhost","--fast","--cache=1024"],"rpcServer":"http://localhost:8545"}
Initialized command: {"name":"Musicoin Wallet","path":"{process.cwd}/bin/gmc/","command":"./gmc","args":["--rpc","--rpcapi=admin,db,eth,net,web3,personal,miner","--rpcport","8545","--rpcaddr","127.0.0.1","--rpccorsdomain","localhost","--fast","--cache=1024"],"rpcServer":"http://localhost:8545","absolutePath":"/tmp/.io.nwjs.Ec0TvT/bin/gmc/"}
Starting Musicoin Wallet: ./gmc, args: [--rpc,--rpcapi=admin,db,eth,net,web3,personal,miner,--rpcport,8545,--rpcaddr,127.0.0.1,--rpccorsdomain,localhost,--fast,--cache=1024], cwd: /tmp/.io.nwjs.Ec0TvT/bin/gmc/
Started Musicoin Wallet: pid=undefined
Failed to start child process Musicoin Wallet: Error: spawn ./gmc ENOENT
Musicoin Wallet: child process exited with code -2
Version 0.8

[5334:5358:0122/164915.373497:ERROR:service_manager.cc(157)] Connection InterfaceProviderSpec prevented service: content_renderer from binding interface: blink::mojom::ReportingServiceProxy exposed by: content_browser
{ financialData: 
   { attach: [Function: bound ],
     accounts: [Getter/Setter],
     userBalance: [Getter/Setter] },
  attach: [Function: bound ],
  lang: [Getter/Setter],
  selectedPage: [Getter/Setter],
  hideSyncWindow: [Getter/Setter],
  chainVersion: [Getter/Setter],
  locale: [Getter/Setter],
  syncStatus: [Getter/Setter],
  userPreferences: { attach: [Function: bound ], username: [Getter/Setter] },
  clientUtils: 
   { convertToMusicoinUnits: [Function: convertToMusicoinUnits],
     getLogDir: [Function: getLogDir],
     formatBalance: [Function: formatBalance] },
  accountModule: 
   { createAccount: [Function: createAccount],
     getAccounts: [Function: getAccounts],
     getCoinbase: [Function: getCoinbase],
     getNodeId: [Function: getNodeId],
     setCoinbase: [Function: setCoinbase],
     getBalance: [Function: getBalance],
     startMining: [Function: startMining],
     stopMining: [Function: stopMining],
     addPeers: [Function: addPeers],
     sendCoins: [Function: sendCoins],
     waitForTransaction: [Function: waitForTransaction] },
  version: [Getter/Setter] }

Especially the line 'Failed to start child process Musicoin Wallet: Error: spawn ./gmc ENOENT' worries me. The 'gmc' binary does exist in the Musicoin-wallet-linux-x64/bin/gmc/ directory however the program seems to be looking for gmc in the /tmp/.io.nwjs.Ec0TvT/bin/gmc/ directory, which doesn't exist.

Varunram commented 6 years ago

Oh, that's weird.. Could you try moving the gmc binary to the above location to see if it works?

dimhoff commented 6 years ago

Yes, that works. Although it is not as simple as just copying the binary, since the process.cwd directory is a temporary directory created at startup. The work around I currently use is run the following command while starting Musicoin-wallet: while true; do for d in .io.nwjs*; do mkdir -p "$d"/bin/gmc; ln -s /home/musicoin/Musicoin-wallet-linux-x64/bin/gmc/gmc "$d"/bin/gmc/gmc; done; done

BeamZappa commented 6 years ago

Hi again Varunram

I'm still getting the ECONNREFUSED 127.0.0.1:8545 with nothing running besides the wallet on two separate PC's, though when I start the GMC app found in bin\gmc, I get a terminal with info that appears to look like some syncing going on, and files being placed in AppData\Roaming\Musicoin\gmc\ethash.

EDIT: The wallet GUI is still saying sync 0% whilst this is going down, I'm gonna let the terminal run till it stops doing things, then see what happens.

Varunram commented 6 years ago

if the gmc app in bin/gmc runs fine, There is no issue (and you shouldn't get the ECONNREFUSED error), the path for the child process is defined as path: "{process.cwd}/bin/gmc/", which would point to your /bin/gmc instance

dimhoff commented 6 years ago

@BeamZappa I don't think we are talking about the same problem here.

@Varunram The ./Musicoin-wallet process forks multiple times and changes directory. By the time the main process is running it has changed directory to a temporary directory. So process.cwd does not longer point to the directory where the Musicoin-wallet executable is located. The temporary directory is removed after the program finishes.

Do you know how the 0.8.0 release was packaged? Still with nwjs-builder and the command line described in the Readme.md?

Are you able to reproduce this behavior or is this specific to my Linux system? I'm using Xubuntu 16.04.

Update: I notice that for 0.8 packaging has changed. In 0.7(0.6.0 according to package.json) all data files are in in the distribution directory. In 0.8 the data files are packed together somewhere in a file. This archive is apparently extracted to a temporary directory then the executable cd's to the temporary directory and executes there. (Windows seems similar)

Note that this also breaks the instructions from the Readme.md. eg. step 4, execute linux-setup.sh is no longer possible since this file is hidden somewhere in an archive. But this also goes for the Readme.md it self, which is not available in the 0.8 release archive.

BeamZappa commented 6 years ago

@Varunram Well that's what the issue is, the wallet wont sync and I still get the ECONNREFUSED error, but the gmc process works if I start it on it's own, I've tried adding the enodes from the terminal to the wallet, same issue, with leads me to think the main wallet app doesn't know where the gmc app is located, I guessed kinda like the issue dimhoff is having, sorry for hijacking in here.

To be fair I don't want to wait god knows how many hours with the gmc app syncing alone to find the actual wallet has no idea it's synced, looks like I've wasted far too long on this already to be honest, wish you luck getting to the moon.

XhmikosR commented 6 years ago

Also, the current approach results in slow startup time. IMHO, this should be tested again and go with the fastest solution.

JazzMaster commented 6 years ago

I can confirm this. Theres another workaround: simply run the gmc binary with those options (take the quotes away) ahead of time and hit the "open anyways" link in the wallet. I see whats going on but why cant we hardcode where gmc is and spawn/fork it from a centralized/normalized location on unices? Futher the failure to find peers: randomly add a few witht he button and provided list. seems to work now.

cryptofuture commented 6 years ago

@dimhoff @JazzMaster Try 1.0 Nightly builds for all supported Operating Systems can be found over at builder.musicoin.org

Supported Operating systems:

  1. Windows 7 and later - 64 bit, 32bit
  2. macOS - 64 bit
  3. Linux - 64 bit, 32bit
  4. Windows XP and older - 32bit, 64 bit
Varunram commented 6 years ago

Please open another issue if you find this in release-1.0