Closed iainhouston closed 8 years ago
I believe the issue is the quotes around both KITURA_host
and KITURA_schema
. The sequence is just spitting back whatever error message it gets from Swift - in this case I'm pretty sure it's getting a null response from the request to the Kitura server, which is the root cause of the Unable to convert value of type Optional<protocol<>>: file Foundation/NSSwiftRuntime.swift, line 269
error message.
Here's what Mine looks like:
# Kitura server export KITURA_host=bluepic-dev.mybluemix.net export KITURA_port=80 export KITURA_schema=http://
When you look at the document in Cloudant, do you see that the weather conditions and tags have been written to the database?
I'm in the process of rewriting the sequence into an orchestrator action that will give us better error messages.
@triceam thanks.
This is the situation now:
$ wsk action invoke processImage -p imageId ef3c12d52ad264ad77e3501855efa61c
gives error: The requested resource does not exist. (code 271368)
where ef3c12d52ad264ad77e3501855efa61c
is the _id
of the db record tagged properly by the app upload{ "imageId": "ef3c12d52ad264ad77e3501855efa61c", "response": "HTTP 200" }
for kituraCallback
at the timestamp of the IOS app uploading the image ... so this would confirm that the local.env
is set up correctly.wsk action invoke processImage
processImage
will produce two different error codes ... not thatI'd know where to look for the codes' meanings ;-) so hopefully your new actions' error message will render more infoBTW I think I tried every export combination with and without quotes in local.env
. Anyhow have reverted to no-quotes now and re-installed the actions and deployed the Bluepic server app again - results above subsequent to this.
@triceam Oh yes it does! In the time it took me to write the comment above and have a cup of tea the "person" tag appeared on the IOS app's info page of the uploaded image. Takes a fair time to get there.
The error "The requested resource does not exist" probably is coming from an issue communicating with the server - meaning it can't find the server. The processCallback action is slightly different since its an intermediary step. Instead of imageId
you need to pass in cloudantId
: wsk action invoke bluepic/processCallback -p cloudantId <cloudant id> -b
Yeah, the sequence takes a while if its doing a cold-start on the actions. If you have the cloudant id, have verified the data gets persisted, and want to test the callback step faster, then just user processCallback like the comment https://github.com/IBM-Swift/BluePic/issues/283#issuecomment-228384264
IF processCallback is successful, it pushes a notification to the client app immediately. If not, the client app doesn't get updated data until that data is requested from the Kitura server again
@triceam thanks. Gradually getting my head around what's going on.
How to determine what's not tying up properly?
wsk action invoke processImage -p imageId <image id>
fails saying thaterror: The requested resource does not exist.
even though all the debug sequences generated by./bluepic.sh --install
do work with thatimage id
(with the exception ofbluepic/processCallback
- but it is not clear to me what are the correct arguments to thiswsk
. )The log says nothing at all when I
wsk action invoke processImage
The log complains that
bluepic/processCallback
islocal.env
saysTags and weather are written to the Cloudant data when the debug sequences are invoked.
For more detail please see this StackOverflow question