IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.03k stars 979 forks source link

Install chaincode error - SDK Cannot find ORG #217

Closed nikhil550 closed 6 years ago

nikhil550 commented 6 years ago

cd ./scripts node install_chaincode.js

results in this error

info: First we enroll /Users/nikhilgupta/fabric/marbles/utils/connection_profile_lib/parts/org.js:102 throw new Error('Cannot find org.', orgName); ^ Error: Cannot find org.

when user is trying to install marbles on his local machine, and the fabric-samples are not installed in the $HOME directory

varshithr commented 6 years ago

Hi Nikhil, I am also facing the same issue. Did you find a solution?

javaer2012 commented 6 years ago

Hi Nikhil & varshithr, I am also facing the same issue. Did you find a solution?

raghurok commented 6 years ago

If your fabric network was created from fabric samples, verify the path of checked out fabric sample project directory in marbles/config/connection_profile_local.json. Incorrect file path in client and organizations config could cause the above issue.

"client": {
        "organization": "Org1MSP",
        "credentialStore": {
            "path": "/$HOME/fabric-samples/fabcar/hfc-key-store"
        }
    },
"organizations": {
        "Org1MSP": {
            "mspid": "Org1MSP",
            "peers": [
                "fabric-peer-org1"
            ],
            "certificateAuthorities": [
                "fabric-ca"
            ],
            "x-adminCert": {
                "path": "/$HOME/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem"
            },
            "x-adminKeyStore": {
                "path": "/$HOME/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/"
            }
        }
    },
c1ick commented 6 years ago

Wow @raghurok , THX!

finally i did it!

bnagpur commented 6 years ago

Hi could anyone share the connection_profile_local.js? I did try to change the path but it does not like it and I am getting the same error: debug: loading pem from a path: C:\Users\IBM_ADMIN\marbles\config\C:\Users\IBM_ADMIN\fabric-samples\basic-network\crypto-config\peerOrganizations\org1.example.com\users\Admin@org1.examp le.com\msp\keystore\cc9e325a581822d9d3ed78806b925c2d9cd9c6f1ca235fc2aa15e0a8a737bdf4_sk fs.js:652 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^

Error: ENOENT: no such file or directory, open 'C:\Users\IBM_ADMIN\marbles\config\C:\Users\IBM_ADMIN\fabric-samples\basic-network\crypto-config\peerOrganizations\org1.example.com\users\ Admin@org1.example.com\msp\keystore\cc9e325a581822d9d3ed78806b925c2d9cd9c6f1ca235fc2aa15e0a8a737bdf4_sk' at Object.fs.openSync (fs.js:652:18) at Object.fs.readFileSync (fs.js:553:33) at Object.cp.loadPem (C:\Users\IBM_ADMIN\marbles\utils\connection_profile_lib\index.js:112:14) at Object.helper.getAdminPrivateKeyPEM (C:\Users\IBM_ADMIN\marbles\utils\connection_profile_lib\parts\org.js:108:17) at Object.cp.makeEnrollmentOptionsUsingCert (C:\Users\IBM_ADMIN\marbles\utils\connection_profile_lib\index.js:238:22) at Object. (C:\Users\IBM_ADMIN\marbles\scripts\install_chaincode.js:42:28) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12)

looks like there is path concatenation taking place: Error: ENOENT: no such file or directory, open 'C:\Users\IBM_ADMIN\marbles\config\C:\Users\IBM_ADMIN\fabric-samples\basic-network\crypto-config\peerOrganizations\org1.example.com\users\ Admin@org1.example.com\msp\keystore\cc9e325a581822d9d3ed78806b925c2d9cd9c6f1ca235fc2aa15e0a8a737bdf4_sk'

I have attached my config file connection_profile_local.txt

huaizhuang700 commented 5 years ago

Hi Nikhil & varshithr & javaer2012, I am also facing the same issue. Did you find a solution?