oceanprotocol / barge

🐳 Docker Compose files for the full Ocean Protocol stack
Apache License 2.0
102 stars 44 forks source link

On MacOS, Barge failing: address.json is missing the entry for 'development' network #386

Closed trentmc closed 1 year ago

trentmc commented 1 year ago

How to reproduce

I'm running MacOS.

First, I did all the steps in pdr-backend barge.md's install section:

That is: In barge console:

# Grab repo
git clone https://github.com/oceanprotocol/barge
cd barge

# Switch to predictoor branch of barge repo
git checkout predictoor

# Clean up previous Ocean-related dirs & containers (optional but recommended) 
rm -rf ~/.ocean
./cleanup.sh
docker system prune -a --volumes

And, I started Docker. (Needed for MacOS.)

Then, I did the steps from predictoor local/local setup:

(Including the fix from #241 to remove --no-aquarius --no-elasticsearch.)

That is: In a different console:

# set ganache block time to 5 seconds, try increasing this value if barge is lagging
export GANACHE_BLOCKTIME=5

#run barge with all bots except predictoor
./start_ocean.sh --no-provider --no-dashboard --predictoor --with-thegraph --with-pdr-trueval --with-pdr-trader --with-pdr-publisher --with-pdr-dfbuyer

Here are my results:

An example symptom: aquarius complains that it can't see "development" network:

Traceback (most recent call last):
  File "events-monitor-main.py", line 51, in <module>
    run_events_monitor()
  File "events-monitor-main.py", line 37, in run_events_monitor
    monitor = EventsMonitor(setup_web3(logger))
  File "/aquarius/aquarius/events/events_monitor.py", line 84, in __init__
    self._start_block = get_metadata_start_block()
  File "/aquarius/aquarius/events/util.py", line 244, in get_metadata_start_block
    if "startBlock" in address_json[network]
KeyError: 'development'
trentmc commented 1 year ago

(These comments were initially in pdr-backend#241. I moved them here, along with the issue itself.

[Trent] (asked @trizin or @alexcos20 for help)

[Berkay] seems like "development" is missing from the address file, could you check if it's there? cat ~/.ocean/ocean-contracts/artifacts/address.json

[Trent] While address.json is there, there is no entry for development This is a failure on barge's part, afaik.

[Berkay] Yep that happens randomly, usually restarting barge from scratch resolves it.

idiom-bytes commented 1 year ago

Hi Trent, today we looked at this ticket but moved on due to how much we needed to cover. We agreed that things are pretty stable, and this was bucketed w/ "just clean up your env".

I'm updating myself on pdr-backend.

My Fix: Was to force docker to fetch latest images. Do you have anything to add from your end?

Maybe this can help to close this.

[Solutions Proposed]

  1. Add Section/Create README to help users "just clean up your env"
  2. Update the original local install README w/ highly-defensive barge bootstrap
    rm -rf ~/.ocean
    ./cleanup.sh
  3. Emphasize force pulling of docker images after pruning volumes inside local install README
  4. Move this ticket to /barge/ repo so it's looked at further by Alex
  5. All of the above
trentmc commented 1 year ago

I have done all of the "proposed solutions" aggressively.

While necessary, they do not solve this problem.

Fyi they are all already in the pdr-backend barge.md file.

Therefore I do not recommend to do any of those recommended actions.

I will move this issue to barge. [done]

trentmc commented 1 year ago

@alexcos20 any tips? From the logs, it appears that contracts get deployed but addresses.json isn't updated with "development"

trentmc commented 1 year ago

My workaround was to run Barge in an Azure VPS. See pdr-backend#297 where I created a README to run barge from a VPS.

This README is currently in pdr-backend; we could port its instructions elsewhere too. But I don't see that as a priority, therefore I won't bother creating issues in this repo, or ocean.py etc.

trentmc commented 1 year ago

I'm hitting this issue even inside the Azure VM running Ubuntu. Reopening.

trentmc commented 1 year ago

Here's the log from my Azure VM: out.txt

trentmc commented 1 year ago

We could close the issue because I could run Ubuntu on VPS. I'd typically have to restart a few times until it worked. But at least it worked. That was the time of my last comment (about Nov 9).

I did re-encounter the issue in Ubuntu on VPS. I've created a new issue for that: barge#390. And I renamed this issue to just MacOS. Therefore we can close this because we are not directly supporting MacOS.