trufflesuite / ganache-ui

Personal blockchain for Ethereum development
https://www.trufflesuite.com/ganache
MIT License
4.65k stars 797 forks source link

Ganache UI has a long (e.g. 45 minute) load time #1630

Open wbt opened 4 years ago

wbt commented 4 years ago

I have a well-resourced machine running Windows10, and downloaded Ganache v2.1.2. I started it up, opened a new workspace, saved that workspace with a custom name (fairly short with no spaces) and used it to run a big truffle migrate job that deployed several contracts and ran several transactions. On automine, Ganache's block number is in the 36K-37K range.

With Ganache still open, I then used truffle migrate several times with a -f [from] parameter while developing an additional migration. (Some of these involved intentionally hitting transaction reverts and migration failures, to test error-handling paths). While doing this, I had a MetaMask-enabled browser open.

After several steps in this process which all went as expected, the app stopped displaying information from the blockchain in the browser. I tried changing the network on MetaMask to mainnet and then back, but MetaMask could not connect to http://127.0.0.1:7545. I tried retrying, using the Restart button in the Ganache UI (which seemed fine), toggling out and back, and entering the URL as a new custom RPC with a different name, and nothing worked. MetaMask still could not connect to the network.

I then closed the Ganache UI, gave it some time to fully close, and re-launched it from the Start Menu. Nothing appeared to happen. After a while, I checked Task Manager and saw several Ganache processes running (with relatively high CPU and disk usage), though there was no UI. I did a right-click and End Task, then waited for all the Ganache processes to disappear and for the CPU+disk usage numbers to calm down. I then tried to launch it again. The processes started up, but there was no UI even after waiting a while. I did another End Task, wait, relaunch, and wait, with the same results, a few times, including at least one where I timed the wait at over half an hour.

A while into this wait, I tried to right-click => more => App Settings, but this just showed a blank white interface with loading dots animating across the top and a scroll-bar on the left (even scrolling down, it's all blank):

image

After about 15 minutes I finally got this: image

The following Task manager screenshot was typical of watching the task manager about 30-45 minutes in to the wait for Ganache's UI to launch. It's using just under 200MB of memory and seems to be doing something, but it's not clear what: image Also, the machine does not seem to be coming up against any significant (>75% usage) resource constraints.

After 45 minutes, the Ganache UI was displayed. I selected to enter the previously created workspace, relaunched the dapp, and visited it in the browser; it displayed correctly. I ran a migration, which succeeded, and reloaded the dapp, seeing that the on-chain information had changed in accordance with what the new migration was intended to do. I then tried to repeat that cycle, but the first step of visiting the dapp in the browser no longer worked: information from the chain was not displayed. Opening MetaMask, it showed the "Connecting" loading spinner for some time, then "Oops! Something went wrong." Try Again resulted in another timeout; same when switching away and back.

Back in the Ganache UI, it seems to still be interactive, but super slow in showing data tabs. Clicking the Accounts, Contracts (none), or Logs tab or Settings shows what's expected. Clicking the Transactions tab shows a yellow loading spinner at the top; clicking Events shows that yellow loading spinner in the middle, and clicking the Blocks tab shows just a white area with no loading spinner, all for indefinite large numbers of minutes.

Under logs, I can scroll up to about the middle of what is shown and see the single transaction from that migration. After that, I see a bunch of one-line logs each containing a timestamp and one of the following:

In many cases, several subsequent lines are identical.

I then flipped back to the Blocks view (white screen) and after about half an hour, did get a list of blocks as expected. I then tried switching networks out (to mainnet) and back in MetaMask, and got the timeout as before. I then tried running the one-transaction migration but after a couple minutes got this response:

Could not connect to your Ethereum client. Please check that your Ethereum client:

  • is running
  • is accepting RPC connections (i.e., "--rpc" option is used in geth)
  • is accessible over the network
  • is properly configured in your Truffle configuration file (truffle.js)

It seems like the Ganache server is not responding to RPC and some other requests.

Expected Behavior

Ganache presents a UI when opened. If the UI cannot be used for normal interaction because Ganache is doing/loading something, it shows more detail about what it's doing.

Current Behavior

No UI, or UI only after a very long wait which may be preceded by timeout of the waiting human.

Steps to Reproduce (for bugs)

Unfortunately, I do not have reliable steps to reproduce right now.

Possible workaround

I suspect that the normal tech support mallet of restarting the computer might fix this at least temporarily, and plan to try that. However, I am posting the bug with some time before doing that, in case there are logs or other things it would be helpful for me to look at while the problem is readily observable.

Additional context

MetaMask #6813 might be the result of a milder version of this Issue.

wbt commented 4 years ago

FYI, I am sometimes (but not always) seeing this even after a fresh system reboot.

wbt commented 4 years ago

I recently had a fresh system reboot and tried to load Ganache. It took literally a day and when it loaded, the workspaces list had two identical entries, for a previously created workspace where the above-described migration completed once. Clicking once to delete was sufficient to delete both. The next startup after this was considerably faster.

Where exactly are those workspaces stored on Windows? Is it a location a typical user can access?

Cirrus-8691 commented 4 years ago

Same problem on linux. Processes running but no UI.

VanijaDev commented 3 years ago

Same for me.... MacOS

santanaruben commented 3 years ago

15 to 45 minutes to open. Windows 10

McJezuss commented 3 years ago

Still having this issue. Windows 10

toadslop commented 3 years ago

I'm having a similar issue. Ganache never loads after adding truffle projects.

zyra-zia commented 3 years ago

I have the same issue. Ganache never loads after adding truffle projects. Windows 10

michaelionita commented 2 years ago

Is there a solution to this yet? Same issue. Usually takes 15 Minutes to load Ganache. M1 Mac Pro 16GB.