PS C:\Users\07\OneDrive\Desktop\Final Try\fabcar-blockchain-sample\web-app\server> node registerUser.js
Wallet path: C:\Users\07\OneDrive\Desktop\Final Try\fabcar-blockchain-sample\web-app\server\wallet
Failed to register user user1: Error: fabric-ca request register failed with errors [[{"code":0,"message":"Registration of 'user1' failed in affiliation validation: Failed getting affiliation 'org1.department1': : scode: 404, code: 63, msg: Failed to get Affiliation: sql: no rows in result set"}]]
**Failed to register user user1.Failed to get Affiliation.Here, in this I'm following the basic Hyperledger faberic Fabcar tutorial. But I'm geting error as failed to Register user user1.msg: Failed to get Affiliation: sql: no rows in result set". The tutorial which I'm following is, https://github.com/IBM/fabcar-blockchain-sample. **
See https://github.com/IBM/fabcar-blockchain-sample/blob/master/web-app/server/registerUser.js#L56
If you change
const secret = await ca.register({ affiliation: 'org1.department1', enrollmentID: userName, role: 'client' }, adminIdentity);
to
const secret = await ca.register({ enrollmentID: userName, role: 'client' }, adminIdentity);
then things should work. I think the demo was created for an older version where we used to have built-in affiliations.