Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Error when query/invoke other chaincode with security enabled #905

Closed
rilaaax opened this issue Mar 30, 2016 · 15 comments
Closed

Error when query/invoke other chaincode with security enabled #905

rilaaax opened this issue Mar 30, 2016 · 15 comments

Comments

@rilaaax
Copy link

rilaaax commented Mar 30, 2016

When trying to query/invoke another chaincode as shown in chaincode_example04 and chaincode_example05, it returns an error when security enabled and CA running.

Some logs (test with chaincode_example05)
mycc log after invoke
mycc2 log after invoke
peer after mycc2 invoke 1 2
peer after mycc2 invoke 2 2

@muralisrini

@muralisrini
Copy link
Contributor

had worked with @rilaaax on this. The issue happens with security/privacy enabled.

@rilaaax : should have checked... can you do one more test please - enable security but not privacy ? Thanks!

@rilaaax
Copy link
Author

rilaaax commented Mar 30, 2016

@muralisrini Test done.

It works with security enabled and privacy disabled.

@muralisrini
Copy link
Contributor

thanks @rilaaax

@rilaaax rilaaax changed the title Error when query/invoke other chaincode with security enabled Error when query/invoke other chaincode with privacy enabled Mar 30, 2016
@wwendy
Copy link

wwendy commented Apr 21, 2016

@rilaaax i tried disabling privacy, security enabled, i got a lot of garbled state output.

@muralisrini
Copy link
Contributor

@wwendy - once privacy is on data is encrypted on the ledger. One cannot switch back and forth between privacy and no privacy (@adecaro to confirm/correct please).

To switch - in test or development phase of course - you could maintain different /var/hyperledger databases or simply rm -rf /var/hyperledger/* (keep /var/hyperledger but delete everything under it).

@wwendy
Copy link

wwendy commented Apr 21, 2016

@muralisrini is it the directory /var/openchain/production/db for openblockchain dev env setup?

@muralisrini
Copy link
Contributor

@wwendy : I assumed you are in hyperledger project.... (though the issue was opened under OBC). Further I assumed you are in vagrant environment. You should adjust the path based on your env.

@adecaro
Copy link
Contributor

adecaro commented Apr 27, 2016

@rilaaax @muralisrini @wwendy is this still opened? Shall I check what's going on in the crypto layer?

@rilaaax
Copy link
Author

rilaaax commented Apr 27, 2016

@adecaro yeah still opened, you do well asking because I just tested again and now it does not work with security enabled not only privacy

@rilaaax rilaaax changed the title Error when query/invoke other chaincode with privacy enabled Error when query/invoke other chaincode with security enabled Apr 27, 2016
@muralisrini
Copy link
Contributor

muralisrini commented Apr 27, 2016

@rilaaax @adecaro - I'm not sure about the recent problem with just security enabled. However the original problem is that we are not dealing with context for encryption/decrytion on the called chaincode correctly when invoking chaincode from a chaincode, So that part @adecaro is a chaincode issue. Think we know where the problem is but looking for the right solution.

@rilaaax ax: I didn't expect just security enabled (with privacy disabled) to fail. One possibility is you might be using the old ledger which had privacy enabled ? Wonder if you could try it after "rm -rf /var/hyperledger/*" (if not already tried of course)

@rilaaax
Copy link
Author

rilaaax commented Apr 28, 2016

@muralisrini i did the rm -rf /var/hyperledger/* command before testing. Got the following error (security enabled / privacy disabled)
09:41:12.633 [chaincode] func1 -> ERRO 227 [0cd73da1]Got error ([0cd73da1]transaction context is nil for uuid 0cd73da1-5167-42f6-90ad-d66b1f8d13fa) while decrypting. Sending ERROR

Tested with all disabled and it is working fine.

@christo4ferris
Copy link
Contributor

@rilaaax @muralisrini is this still an issue? If not, let's close it. Thanks

@muralisrini
Copy link
Contributor

muralisrini commented Jul 25, 2016

@christo4ferris Its a known limitation. C-C with privacy is being looked in detail for the New arch. This can be closed, I think. Agree, @rilaaax ?

@rilaaax
Copy link
Author

rilaaax commented Jul 26, 2016

@muralisrini I didn't test it recently but if you say it will be fixed soon we can close it. @christo4ferris

@christo4ferris
Copy link
Contributor

closing per discussion

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

5 participants