天天看點

Filecoin常見問題處理

 1編譯 lotus 失敗: *** No rule to make target '.install-filcrypto'. Stop.

則直接删除 

./extern/

 目錄,然後重新編譯:

rm -rf ./extern/
FFI_BUILD_FROM_SOURCE=1 make clean debug      

2 編譯 lotus 失敗:Get "https://proxy.golang.org/github.com/xxxxxx": net/http: TLS handshake timeout

則需要設定 

GOPROXY

 這個環境變量,然後重新編譯:

export GOPROXY=https://goproxy.cn
FFI_BUILD_FROM_SOURCE=1 make debug  # 此時不需要執行 clean 操作      

3 編譯 lotus 失敗:server response: not found: module github.com/filecoin-project/lotus/extern/storage-sealing/sealiface: no matching versions for query "latest"

則,更換代碼版本吧,這個版本的代碼有問題,目前出現這個問題的代碼版本是:

v1.4.2-rc1

4 運作 lotus 出現崩潰:SIGILL: illegal instruction

這個一般是老機器才會出現的問題,由于老機器不支援 

adx

 等指令導緻的, 解決方法: 編譯的時候加上參數 CGO_CFLAGS="-D__BLST_PORTABLE__":

FFI_BUILD_FROM_SOURCE=1 CGO_CFLAGS="-D__BLST_PORTABLE__" make clean debug      

5 啟動 daemon 失敗:xxxxx: genesis in the repo is not the one expected by this version of Lotus!

如果啟動 daemon 的時候出現如下所示的錯誤:

xxxxx: genesis in the repo is not the one expected by this version of Lotus!

則建議不要使用這個版本的代碼,如果一定要使用,則可以在啟動 

daemon

 之前設定一下環境變量:

export LOTUS_SKIP_GENESIS_CHECK=_yes_
      

6 daemon 同步失敗:Received block with impossibly large height xxx

在測試本地測試網的時候,如果創世節點的代碼編譯的時候使用的是 

Debug

 模式,而其它節點的代碼編譯的時候使用 

Release

 模式,則在啟動新節點的時候,運作完 

lotus net connect xxxx

 指令的時候,有可能在 

daemon

 的日志中看到這個錯: 

ERROR chain chain/sync.go:236 Received block with impossibly large height 197

,看到這個錯誤之後,新節點後續的操作都不會成功(比如同步節點資訊,或者從創世節點發送一些 

FIL

 到新曠工的錢包等)。

解決的方法就是讓新節點的代碼也是用 

Debug

 模式編譯。

7 啟動創世節點失敗:VM.Call failure: Allowance 4096 below MinVerifiedDealSize for add verifier f081 (RetCode=16)

這個錯誤資訊,是因為啟動創世節點的時候(搭建本地 

2KiB

 測試網),所使用的代碼的編譯模式沒有使用 

Debug

 模式(大機率是因為使用了 

Release

 模式編譯代碼)導緻的,如下所示:

# 錯誤資訊
WARN	vm	vm/runtime.go:332	Abortf: Allowance 4096 below MinVerifiedDealSize for add verifier f081
WARN	vm	vm/runtime.go:145	VM.Call failure: Allowance 4096 below MinVerifiedDealSize for add verifier f081 (RetCode=16):
genesis func failed: make genesis block: 
failed to verify presealed data: 
failed to create verifier: 
doExec apply message failed: Allowance 4096 below MinVerifiedDealSize for add verifier f081 (RetCode=16)      

解決方法是使用 

Debug

 模式重新編譯一次代碼,然後重新啟動創世節點。

8 檢視錢包清單出現 Warn:error in RPC call to 'Filecoin.WalletDefaultAddress': failed to get default key: xxx key info not found

這不是一個 Error,其實可以不用管它,消除這個 

Warn

 的方法也很簡單,因為這個警告的意思是指:使用者沒有設定預設錢包,可能是因為使用者在導入創世錢包的時候 

./lotus wallet import xxx

 沒有指定 

--as-default

 參數,或者是導入之後沒有執行 

./lotus wallet set-default xxx

 設定預設錢包(隻要有預設錢包就不會報這個警告了)。 是以,消除這個警告的方法就是在導入錢包的時候加上 

--as-default

 參數,或者在導入錢包之後執行 

./lotus wallet set-default xxx

 設定預設錢包即可。

9 檢視Miner 資訊:ERROR: could not get API info: could not get api endpoint: API not running (no endpoint)

如果是在執行 

./lotus-miner xxx

 的時候看到這個錯誤,則說明你的 

miner

 還沒有啟動,或者是 

miner

 的預設目錄不是 

~/.lotusminer/

,而你執行名的這邊(執行指令所在的終端)沒有檢測到你的 

miner

 所使用的目錄。比如, 

miner

 那邊運作的時候設定了 

export LOTUS_STORAGE_PATH=/lotusminer

,而執行指令這邊沒有檢測到 

LOTUS_STORAGE_PATH

 這個環境變量。

如果是在執行 

./lotus xxx

 的時候看到這個錯誤,則原理和 

miner

 類似。

10 lotus 編譯錯誤:/usr/bin/ld: cannot find -lhwloc

如果在編譯過程中遇到這個錯誤,則說明你的系統中沒有安裝 

hwloc

 相關的庫:

解決方法,安裝 

hwloc

 相關的庫,然後再重新編譯 

lotus

sudo apt get install hwloc libhwloc-dev
      

11 miner 的日志中顯示 drand 錯誤:failed getting beacon entry:

錯誤資訊(drand:distributed random):

ERROR   miner   miner/miner.go:208      
 failed getting beacon entry: drand failed Get request: no valid clients - doing request:
 Get "https://api3.drand.sh/public/643563": context deadline exceeded - doing request: 
 Get "https://api2.drand.sh/public/643563": context deadline exceeded - doing request: 
 Get "https://drand.cloudflare.com/public/643563": context deadline exceeded - doing request: 
 Get "https://api.drand.sh/public/643563": context deadline exceeded      

這個錯誤一般都是你的機器無法聯網導緻的,或者網絡不穩定等,導緻 

miner

 無法通路到分布式随機數伺服器,而且,如果一直無法通路的話, 

miner

 的 log 日志中會不斷的輸出這個錯誤資訊,如果 

miner

 的 log 日志中已經暫定輸出這個錯誤資訊,則說明已經恢複正常(

WaitSeed

 階段需要正确獲得 

drand

 資訊才能繼續)。

12 lotus 的日志中顯示錯誤:block was from the future:

錯誤資訊如下所示:

2021-03-29T23:03:52.060+0800	ERROR	chain	chain/sync.go:1500	failed to validate tipset: validating block bafy2bzacedn4somb5xy634kgn56tnmrhs7yg7lje4u2iqpod6d74yvndvwdgu:
    github.com/filecoin-project/lotus/chain.(*Syncer).ValidateTipSet.func1
        /home/ml/git2/lotus/chain/sync.go:620
  - block was from the future (now=1617030232, blk=1617030234):
    github.com/filecoin-project/lotus/chain.(*Syncer).ValidateBlock
        /home/ml/git2/lotus/chain/sync.go:743
  - temporal error      

這個錯誤資訊一般會持續的輸出,原因是你的機器的時間和其它機器的時間不一緻導緻的,你可以通過更新機器時間來解決這個問題,具體方式如下:

sudo ntpdate  ntp.aliyun.com      

同步好時間之後,重新開機 

daemon

 和 

miner

 一般就可以了。

13 Worker 啟動失敗:API not running (no endpoint)

錯誤資訊如下所示:

Connecting to miner API... (could not get API info: could not get api endpoint: API not running (no endpoint))      

這個錯誤資訊是因為你的 

worker

 機器中沒有配置 

miner

 的 

API token

,解決方法是在把 

miner的位址配置上。

繼續閱讀