Open JGreenlee opened 4 months ago
@JGreenlee interesting. given that:
I think that the problem is with a server error, probably related to the database. The error that we actually see is likely because we tried to parse the error on the server as JSON and failed. e.g. https://stackoverflow.com/a/63679740
I checked the server logs, and it looks like the errors don't actually show up in the streamed console logs. It might be easiest to print out the string in the native code before converting to JSON.
@JGreenlee LMK if you can do this, or whether I should (not sure if you are using the devapp or re-building)
@JGreenlee LMK if you can do this, or whether I should (not sure if you are using the devapp or re-building)
I think I can do that. I know how to build; I will just have to learn how to log from Objective-C
The native code is expecting a JSON string in the response, and it receives an HTML string instead. It appears to be the HTML of https://www.nrel.gov/transportation/openpath.html
I think this means the server is not recognizing /customlabel/update
as a route and it's defaulting to something else.
@shankari Is there an extra step needed to configure new routes?
We may want to leave that log in (catch the exception, log and then rethrow) to help catch such issues in the future.
Yes that is what it means.
Sorry, the requested URL 'https://openpath-stage.nrel.gov/usercache/get' caused an error:
Method not allowed.``` ``` $ curl https://openpath-stage.nrel.gov/api/usercache/put
Sorry, the requested URL 'https://openpath-stage.nrel.gov/usercache/put' caused an error:
Method not allowed.``` ``` $ curl https://openpath-stage.nrel.gov/api/customlabel/update $ curl https://openpath-stage.nrel.gov/api/customlabel/get $ ```
It certainly looks like the new API endpoints have not been deployed. There should not be an extra step needed to configure the new routes, as we can see from the fact that the server works locally.
Double-checking deployment steps:
So we should have the new code deployed. I'm going to deploy from the image and see if I can verify. It would be good to also print out some kind of version information from the server at startup so we can verify which version is running.
Ok so this is weird. I build the new image on Jul 23 and it was successful.
But I don't see the related image in the registry
Confirmed that the most recent image (the one from jul 18) does not have the changes.
$ docker run -p 8080:8080 -it <image from jul 18> /bin/bash
root@d246f9a5c2cb:/usr/src/app# grep -r customlabel emission/net/
root@d246f9a5c2cb:/usr/src/app#
So what was deployed? Was it actually the new image? @jgu2 can you take a look on whether this is related to your recent stage versus prod channel changes?
Fixed by @jgu2, re-deployed on staging
@JGreenlee @louisg1337 assuming it does, can one of you submit a PR with the code that Jack added (catch the JSON format exception and rethrow with the raw response)? It will help debug such issues more easily in the future.
Rebuilt | but no new tag generated |
---|---|
This error occurs when adding any custom label.
It is 100% reproducible using
e-mission-phone
(at master) and connecting to the staging server. However, it is not reproducible when connecting to a local instance ofe-mission-server
(also at master); even with e-mission-phone still at master and same config (I was usingstage-study
). I am perplexed by this.The error message would suggest malformed JSON, but I inspected what the UI is sending and it looks fine:
DEBUG:About to update custom label: {"key":"mode","old_label":"","new_label":"skateboard","is_new_label_must_added":true}
Googling the error message reveals that the error occurs in iOS native code. However, I couldn't find any more details in the loggerDB logs.
On the server logs, it appears that the
/customlabel/update
request is initiated and immediately exits:This is what
/customlabel/update
should be doing:...but not even "Called updateUserCustomLabel" gets logged out.