iotaledger / hornet

HORNET is a powerful IOTA fullnode software
Apache License 2.0
311 stars 151 forks source link

PANIC Snapshot snapshot/core.go:162 no download URL specified for snapshot files in config #1062

Closed oyren closed 3 years ago

oyren commented 3 years ago
**Describe the bug** Hello, I wanted to update Hornet from 0.5.6 to 1.0.1, using Docker and Docker Compose. I have downloaded the config.json and peer.json from Github. And created the folders with ``` mkdir mainnetdb && sudo chown 39999:39999 mainnetdb mkdir -p snapshots/mainnet && sudo chown 39999:39999 snapshots -R ``` . Here in Github at https://github.com/gohornet/hornet/tree/main/docker it still says ``` mkdir mainnetdb && chown 65532:65532 mainnetdb mkdir snapshots/mainnet && chown 65532:65532 snapshots -R ``` , I tried that too. After that I tried with docker-compose up to start Hornet, result is the following: ``` console iota_hornet | 2021-04-29T08:14:17Z INFO Node node/node.go:214 Loading core plugin: P2P ... done iota_hornet | 2021-04-29T08:14:17Z INFO Node node/node.go:214 Loading core plugin: Gossip ... done iota_hornet | 2021-04-29T08:14:17Z INFO Node node/node.go:214 Loading core plugin: Tangle ... done iota_hornet | 2021-04-29T08:14:17Z PANIC Snapshot snapshot/core.go:162 no download URL specified for snapshot files in config iota_hornet | github.com/gohornet/hornet/core/snapshot.configure iota_hornet | /app/core/snapshot/core.go:162 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).configure.func1 iota_hornet | /app/pkg/node/node.go:212 iota_hornet | github.com/gohornet/hornet/pkg/node.forEachCorePlugin iota_hornet | /app/pkg/node/node.go:320 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).ForEachCorePlugin iota_hornet | /app/pkg/node/node.go:328 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).configure iota_hornet | /app/pkg/node/node.go:210 iota_hornet | github.com/gohornet/hornet/pkg/node.New iota_hornet | /app/pkg/node/node.go:49 iota_hornet | github.com/gohornet/hornet/pkg/node.Run iota_hornet | /app/pkg/node/node.go:62 iota_hornet | main.main iota_hornet | /app/main.go:33 iota_hornet | runtime.main iota_hornet | /usr/local/go/src/runtime/proc.go:225 iota_hornet | panic: no download URL specified for snapshot files in config iota_hornet | iota_hornet | goroutine 1 [running]: iota_hornet | go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000ce2000, 0x0, 0x0, 0x0) iota_hornet | /go/pkg/mod/go.uber.org/zap@v1.16.0/zapcore/entry.go:234 +0x58d iota_hornet | go.uber.org/zap.(*SugaredLogger).log(0xc000134780, 0x4, 0x0, 0x0, 0xc000cd1d30, 0x1, 0x1, 0x0, 0x0, 0x0) iota_hornet | /go/pkg/mod/go.uber.org/zap@v1.16.0/sugar.go:234 +0xf6 iota_hornet | go.uber.org/zap.(*SugaredLogger).Panic(...) iota_hornet | /go/pkg/mod/go.uber.org/zap@v1.16.0/sugar.go:123 iota_hornet | github.com/gohornet/hornet/core/snapshot.configure() iota_hornet | /app/core/snapshot/core.go:162 +0x119 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).configure.func1(0xc0000a4cd0, 0x1c5c701) iota_hornet | /app/pkg/node/node.go:212 +0xdd iota_hornet | github.com/gohornet/hornet/pkg/node.forEachCorePlugin(0xc00014d800, 0x9, 0x10, 0xc000cd1e40) iota_hornet | /app/pkg/node/node.go:320 +0x51 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).ForEachCorePlugin(...) iota_hornet | /app/pkg/node/node.go:328 iota_hornet | github.com/gohornet/hornet/pkg/node.(*Node).configure(0xc0006e4ee0) iota_hornet | /app/pkg/node/node.go:210 +0x7c iota_hornet | github.com/gohornet/hornet/pkg/node.New(0xc0007a3f60, 0x3, 0x3, 0x1d3ba40) iota_hornet | /app/pkg/node/node.go:49 +0x248 iota_hornet | github.com/gohornet/hornet/pkg/node.Run(0xc0007a3f60, 0x3, 0x3, 0xc00007c9a0) iota_hornet | /app/pkg/node/node.go:62 +0x3f iota_hornet | main.main() iota_hornet | /app/main.go:33 +0x334 ``` Here is my docker-compose.yml: ``` docker version: '3.3' services: hornet: container_name: iota_hornet image: gohornet/hornet:latest volumes: - ./config.json:/app/config.json:ro - ./peering.json:/app/peering.json - ./mainnetdb:/app/mainnetdb - ./snapshots/mainnet:/app/snapshots/mainnet restart: unless-stopped network_mode: "host" cap_drop: - ALL ``` ``` console $ ls -alh total 32K drwxr-xr-x 4 root root 4.0K Apr 28 21:34 ./ drwxr-xr-x 8 root root 4.0K Apr 28 20:09 ../ -rw-r--r-- 1 65532 65532 5.1K Apr 28 21:34 config.json -rw-r--r-- 1 root root 530 Apr 28 20:14 docker-compose.yml drwxr-xr-x 2 65532 65532 4.0K Apr 28 20:11 mainnetdb/ -rw-r--r-- 1 65532 65532 18 Apr 28 21:27 peering.json drwxr-xr-x 3 65532 65532 4.0K Apr 28 20:11 snapshots/ ``` I also tried it once following the complete instructions from here https://github.com/gohornet/hornet/tree/main/docker, so using git clone and then building it myself and got the same result. **Environment information:** - OS: Debian 10 (4.19.0-16-amd64 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux) - RAM: 30 GB - Cores: 8 Core - Type: VPS - HORNET version: 1.01 - Docker version 20.10.6, build 370c289 - docker-compose version 1.29.1, build c34c88b2 ``` console $ cat config.json { "restAPI": { "jwtAuth": { "enabled": false, "salt": "HORNET" }, "excludeHealthCheckFromAuth": false, "permittedRoutes": [ "/health", "/mqtt", "/api/v1/info", "/api/v1/tips", "/api/v1/messages/:messageID", "/api/v1/messages/:messageID/metadata", "/api/v1/messages/:messageID/raw", "/api/v1/messages/:messageID/children", "/api/v1/messages", "/api/v1/transactions/:transactionID/included-message", "/api/v1/milestones/:milestoneIndex", "/api/v1/milestones/:milestoneIndex/utxo-changes", "/api/v1/outputs/:outputID", "/api/v1/addresses/:address", "/api/v1/addresses/:address/outputs", "/api/v1/addresses/ed25519/:address", "/api/v1/addresses/ed25519/:address/outputs", "/api/v1/treasury" ], "whitelistedAddresses": [ "127.0.0.1", "::1" ], "bindAddress": "0.0.0.0:14265", "powEnabled": true, "powWorkerCount": 1, "limits": { "bodyLength": "1M", "maxResults": 1000 } }, "dashboard": { "bindAddress": "0.0.0.0:8081", "auth": { "sessionTimeout": "72h", "username": "admin", "passwordHash": "24c832e35dc542901b90888321dbfc4b1d9617332cbc124709204e6edf7e49f9", "passwordSalt": "6c71f4753f6fb52d7a4bb5471281400c8fef760533f0589026a0e646bc03acd4" }, "db": { "engine": "rocksdb", "path": "mainnetdb", "autoRevalidation": false }, "snapshots": { "depth": 50, "interval": 200, "fullPath": "snapshots/mainnet/full_snapshot.bin", "deltaPath": "snapshots/mainnet/delta_snapshot.bin", "deltaSizeThresholdPercentage": 50.0, "downloadURLs": [ { "full": "https://chrysalis-dbfiles.iota.org/snapshots/hornet/latest-full_snapshot.bin", "delta": "https://chrysalis-dbfiles.iota.org/snapshots/hornet/latest-delta_snapshot.bin" } ] }, "pruning": { "enabled": true, "delay": 60480, "pruneReceipts": false }, "protocol": { "networkID": "chrysalis-mainnet", "bech32HRP": "iota", "minPoWScore": 4000, "milestonePublicKeyCount": 2, "publicKeyRanges": [ { "key": "a9b46fe743df783dedd00c954612428b34241f5913cf249d75bed3aafd65e4cd", "start": 0, "end": 777600 }, { "key": "365fb85e7568b9b32f7359d6cbafa9814472ad0ecbad32d77beaf5dd9e84c6ba", "start": 0, "end": 1555200 } ] }, "pow": { "refreshTipsInterval": "5s" }, "requests": { "discardOlderThan": "15s", "pendingReEnqueueInterval": "5s" }, "receipts": { "backup": { "enabled": false, "folder": "receipts" }, "validator": { "validate": false, "api": { "address": "http://localhost:14266", "timeout": "5s" }, "coordinator": { "address": "UDYXTZBE9GZGPM9SSQV9LTZNDLJIZMPUVVXYXFYVBLIEUHLSEWFTKZZLXYRHHWVQV9MNNX9KZC9D9UZWZ", "merkleTreeDepth": 24 } } }, "tangle": { "milestoneTimeout": "30s" }, "tipsel": { "maxDeltaMsgYoungestConeRootIndexToCMI": 8, "maxDeltaMsgOldestConeRootIndexToCMI": 13, "belowMaxDepth": 15, "nonLazy": { "retentionRulesTipsLimit": 100, "maxReferencedTipAge": "3s", "maxChildren": 30, "spammerTipsThreshold": 0 }, "semiLazy": { "retentionRulesTipsLimit": 20, "maxReferencedTipAge": "3s", "maxChildren": 2, "spammerTipsThreshold": 30 } }, "node": { "alias": "HORNET node", "profile": "auto", "disablePlugins": [], "enablePlugins": [ "Spammer" ] }, "p2p": { "bindMultiAddresses": [ "/ip4/0.0.0.0/tcp/15600" ], "connectionManager": { "highWatermark": 10, "lowWatermark": 5 }, "gossipUnknownPeersLimit": 4, "identityPrivateKey": "", "peerStore": { "path": "./p2pstore" }, "reconnectInterval": "30s" }, "p2pdisc": { "advertiseInterval": "30s", "maxDiscoveredPeerConns": 4, "rendezvousPoint": "between-two-vertices", "routingTableRefreshPeriod": "60s" }, "logger": { "level": "info", "disableCaller": true, "encoding": "console", "outputPaths": [ "stdout" ] }, "warpsync": { "advancementRange": 150 }, "spammer": { "message": "IOTA - A new dawn", "index": "HORNET Spammer", "indexSemiLazy": "HORNET Spammer Semi-Lazy", "cpuMaxUsage": 0.8, "mpsRateLimit": 5.0, "workers": 0, "autostart": false }, "mqtt": { "bindAddress": "localhost:1883", "wsPort": 1888, "workerCount": 100 }, "profiling": { "bindAddress": "localhost:6060" }, "prometheus": { "bindAddress": "localhost:9311", "fileServiceDiscovery": { "enabled": false, "path": "target.json", "target": "localhost:9311" }, "databaseMetrics": true, "nodeMetrics": true, "gossipMetrics": true, "cachesMetrics": true, "restAPIMetrics": true, "migrationMetrics": true, "coordinatorMetrics": true, "debugMetrics": false, "goMetrics": false, "processMetrics": false, "promhttpMetrics": false } } ``` P.S. the hash of the password is exemplary.
oyren commented 3 years ago

You go to the trouble of creating a Issue and the next moment you find the solution ;). At least now I'm getting a permission error.

What fixed the error above was the following pull request https://github.com/gohornet/hornet/pull/1060 So the /app/ in my Docker compose file was too much.

New docker-compose.yml:

version: '3.3'
services:
        hornet:
                container_name: iota_hornet
                image: gohornet/hornet:latest
                volumes:
                        - ./config.json:/config.json:ro
                        - ./peering.json:/peering.json
                        - ./mainnetdb:/mainnetdb
                        - ./snapshots/mainnet:/snapshots/mainnet
                restart: unless-stopped
                network_mode: "host"
                cap_drop:
                        - ALL
oyren commented 3 years ago

Ok nope permission error fixed and have the error from above again.

iota_hornet | 2021-04-29T09:05:50Z      PANIC   Snapshot        snapshot/core.go:162    no download URL specified for snapshot files in config
Ephaltes commented 3 years ago

@legacycode

I also had the same problem as OP, so I implemented your commits but now I am getting a mainenetdb permission denied. I tried it with both 39999 and 65532

error_65532 65532_1

Same with 39999

error_39999

39999_1

oyren commented 3 years ago

Yes the same problem mainnetdb/LOCK: Permission denied was my permission problem from above, I had workaround it by giving the folders all rights (chmod 777 -R folder/filename).

legacycode commented 3 years ago

There are more than one issues with the docker file. I am working on a fix. You can try my feature branch at: https://github.com/legacycode/hornet/tree/fix-docker and check if it solves the issues. I will create a PR in a few hours.

oyren commented 3 years ago

I will look into it, thanks. Could you please clarify that

mkdir mainnetdb && sudo chown 39999:39999 mainnetdb
mkdir -p snapshots/mainnet && sudo chown 39999:39999 snapshots -R 

is correct?

legacycode commented 3 years ago

@oyren Please have a look at #1068. I have documented the steps to check my PR. Please comment directly in the PR, if you find any issues in my solution. Thanks and best regards.

oyren commented 3 years ago

With your adjustments @legacycode I have version 1.0.1 running now, thanks. I will leave the Issue open until it is merged.

oyren commented 3 years ago

@legacycode I'm not sure if this is related, but I always get a new peeringid after docker-compose down & docker-compose up.

muXxer commented 3 years ago

@oyren create a different issue for that :) that's another problem we also need to fix in the hornet code itself and the docker file.

@legacycode thank you for your help with this issue!