farcasterxyz / hub-monorepo

Implementation of the Farcaster Hub specification and supporting libraries for building applications on Farcaster
https://www.thehubble.xyz
MIT License
701 stars 393 forks source link

Unable to sync hubble locally #2078

Open louislucrypto opened 3 months ago

louislucrypto commented 3 months ago

What is the bug? Following the steps in https://docs.farcaster.xyz/hubble/install#install-via-docker I'm able to set up hubble and grafana but it alsways failed to sync

Here are the message I got

2024-06-21 00:39:05 {"message":" ███████████████████░░░░░░░░░░░░░░░░░░░░░  47% | Getting snapshot | 1555/3300 | ETA: NFs","timestamp":"2024-06-21T04:39:05.603Z","type":"err","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"\n","timestamp":"2024-06-21T04:39:05.603Z","type":"err","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"\n","timestamp":"2024-06-21T04:39:05.604Z","type":"err","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"\n","timestamp":"2024-06-21T04:39:05.603Z","type":"err","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"\n","timestamp":"2024-06-21T04:39:05.604Z","type":"err","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"{\"level\":60,\"time\":1718944745605,\"pid\":29,\"hostname\":\"560f088b6cf1\",\"err\":{\"type\":\"Error\",\"message\":\"Failed to start hub: failed to sync snapshot - Error extracting snapshot\",\"stack\":\"Error: Failed to start hub\\n    at file:///home/node/app/apps/hubble/src/cli.ts:697:14\\n    at /home/node/app/node_modules/neverthrow/dist/index.cjs.js:113:102\\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\\n    at Command.<anonymous> (file:///home/node/app/apps/hubble/src/cli.ts:695:25)\\ncaused by: HubError: failed to sync snapshot - Error extracting snapshot\\n    at Hub.attemptCatchupSyncWithSnapshot (file:///home/node/app/apps/hubble/src/hubble.ts:933:20)\\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\\n    at Hub.start (file:///home/node/app/apps/hubble/src/hubble.ts:594:27)\\n    at Command.<anonymous> (file:///home/node/app/apps/hubble/src/cli.ts:695:25)\"},\"msg\":\"Failed to start hub\"}\n","timestamp":"2024-06-21T04:39:05.630Z","type":"out","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:05 {"message":"{\"level\":60,\"time\":1718944745630,\"pid\":29,\"hostname\":\"560f088b6cf1\",\"reason\":\"Hub Startup failed\",\"msg\":\"shutting down hub\"}\n","timestamp":"2024-06-21T04:39:05.630Z","type":"out","process_id":0,"app_name":"hubble"}
2024-06-21 00:39:06 {"hostname":"560f088b6cf1","pid":29,"time":1718934081226,"level":30,"msg":"Creating new RocksDB","component":"RustRocksDB","path":".rocks/rocks.hub._default"}
2024-06-21 00:39:06 {"hostname":"560f088b6cf1","pid":29,"time":1718934081226,"level":30,"msg":"Creating new RocksDB","component":"RustRocksDB","path":".rocks/rocks.hub._default/trieDb"}
2024-06-21 00:39:06 {"hostname":"560f088b6cf1","pid":29,"time":1718934081226,"level":30,"msg":"Creating new RocksDB","component":"RustRocksDB","path":".rocks/farcaster"}
2024-06-21 00:39:06 {"hostname":"560f088b6cf1","pid":29,"time":1718934081226,"level":30,"msg":"Creating new RocksDB","component":"RustRocksDB","path":".rocks/rocks.hub._default/trieDb"}
2024-06-21 00:39:06 {"hostname":"560f088b6cf1","pid":29,"time":1718934081226,"level":30,"msg":"Opened database","component":"RustRocksDB","path":".rocks/rocks.hub._default/trieDb"}

My question is why does hubble create a new db when sync failed? Ideally it should keep original record then continue the sync. How everytime when it failed, I have to start from 0%

How can it be reproduced? (optional) Not sure if this occurs to other hub runner

Additional context (optional) I'm running on f25f133f30aa80283252da06d325e8b0150bdaa3 commit from hub-monorepo Running docker on windows OS Name Microsoft Windows 11 Home Docker Engine version is v26.1.4

louislucrypto commented 3 months ago

I'll try everything again from bca9618d98ce64b2427fcd0692870a365c29f611 since this is the latest tag.

stevenjoe0906 commented 3 months ago

I'm facing the same issue. It often fails, I have to re-sync from scratch.

sds commented 2 months ago

Thanks for the report, @louislucrypto.

We're aware of an issue where if the connection is lost during the initial snapshot download a RocksDB corruption can occur.

Unclear if this is the same as your issue, but it looks similar. See this comment for context.

danish46k commented 2 months ago

@sds we all are still getting same error in local machines please do something sir please

danish46k commented 2 months ago

@sds my pc config ram=16 ssd=1TB processors= 6 core os=ubuntu latest

even i formaed entire ssd just booted with ubuntu latest and tried all things from start but still not able to sync 100% hubble even mine network is also speed and stable why this happining again and again please solve this