Blockchain App Builder CLI 故障排除

以下信息可用于解决区块链应用程序构建器 CLI 的系统问题。

先决条件问题
如果修改或升级 Blockchain App Builder 所需的任何先决条件软件,则可能会发生错误。您可以使用 preReqCheck 命令检查区块链应用程序构建器的安装是否仍满足先决条件。

使用情况:

preReqCheck [options]
my-mac:TsProject myname$ ochain preReqCheck -h 
Usage: patch [options]

Validates the pre-requisites of Blockchain App Builder 

Options :
    -h, --help              output command usage information
    -D, --debug             enable debug logging
如果在尝试安装区块链应用程序构建器时先决条件检查失败,并出现错误和警告,您可能会看到类似于以下示例的错误:
npm ERR! code 1
npm ERR! path C:\Users\opc\AppData\Roaming\npm\node_modules\@oracle\ochain-cli
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node build/pre-install.js
npm ERR! NodeJs version is correct.
npm ERR! NPM version is correct.
npm ERR! Error:
npm ERR! Found 1 error(s) in pre-requisites check, failed with following errors:
npm ERR! 1. Golang version mismatch. Expected 1.20.x, but found 1.18.5.
npm ERR!
npm ERR! Found 3 warning(s) in pre-requisites check.
npm ERR! 1. Docker is not installed. Please install Docker >= 18.09.0. To deploy chaincodes in the local environment, please install the recommended version of Docker.
npm ERR! 2. Docker Compose is not installed. Please install Docker Compose >= 1.23.0. To deploy chaincodes in the local environment, please install the recommended version of Docker Compose.
npm ERR! 3. Git is not Installed. To sync chaincodes, please install the Git according to the documentation.
npm ERR!     at preRequsiteCheck (C:\Users\opc\AppData\Roaming\npm\node_modules\@oracle\ochain-cli\build\lib\util\pre-install.js:435:15)
npm ERR!     at Object.<anonymous> (C:\Users\opc\AppData\Roaming\npm\node_modules\@oracle\ochain-cli\build\pre-install.js:10:44)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1254:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1117:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:958:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:23:47
 
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\opc\AppData\Local\npm-cache\_logs\2023-08-25T09_58_34_514Z-debug-0.log
部署故障
由于部署失败、部署损坏、Docker 对等端容器已满或在本地网络中终止 Docker 对等端,您可能会看到类似于以下内容的错误:
============ Started instantiate Chaincode ============
[2028-19-01T19:25:lO.372] [ERROR] default - Error instantiating Chaincode GollGl on channel mychannel, detailed 
error: Error: error starting container: error starting container: Failed to generate platform-specific docker 
build: Failed to pull hyperledger/fabric-ccenv:latest : API error (404): manifest for hyperledger/ 
fabric-ccenv:latest not found: manifest unknown: manifest unknown [2020-19-01T19:25:10.372] (INFO) default -
============ Finished instantiate Chaincode ============
[2020-19-01119:25:10.372] [ERROR] default - Error: Error instantiating Chaincode Goll01 on channel mychannel, 
detailed error: Error: error starting container: error starting container: Failed to generate platfom-specific 
docker build: Failed to pull hyperledger/fabric-ccenv: latest : API error (404): manifest for hyperledger/ 
fabric-ccenv:lalest not found: manifest unknown: manifest unknown exited: signal: terminated 
INFO: exited: signal: terminated

ERROR: Error in Chaincode deployment
这是因为对等容器无法再次正常启动。要解决此行为,请完成以下步骤。
  • 在链代码项目中打开一个新的终端窗口并运行 ochain run -b 命令。
Blockchain App Builder CLI 重建本地网状结构网络环境并将链代码部署到新环境。
Mac OSX:Xcode
在升级 Mac OSX 或未安装 Xcode 后,您可能会在错误日志中看到类似于以下内容的错误:
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at
  • 要解决此行为,请打开终端窗口并运行以下命令:
    sudo rm -rf $(xcode-select --print-path)
    xcode-select --install