-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to update environment: invalid character '<' looking for beginning of value #135
Comments
Hi @nishant-shah-social, can you provide a bit more information here please? Where are you seeing this error please? If you can provide information about your setup, that would be very helpful. For example, the following details will be necessary for us to investigate this:
Any other information you can provide that might help us will be very helpful as well. Thanks! |
Sure @matthewelwell ! the code snippet
where NewflagsmithClient() has the logic to set all the options and then initialize flagsmith with something like:-
While evaluation, we use following call:-
Hope this helps! Let me know if any further info is required Thanks, |
Thanks for the details @nishant-shah-social, we'll take a look into this and update here with any findings. |
@gagantrivedi incase you got time to look into it? |
@nishant-shah-social The error sounds like your self-hosted Flagsmith is returning HTML instead of JSON. Could you double check that your API URL is something like |
@nishant-shah-social did you have a chance to confirm regarding the outstanding question here? |
@rolodato @matthewelwell Sorry for the delayed response. Our API URL does have this trailing slash. I see this error happening intermittently and not always. Further investigations revealed that his error occurs when due to some reason SDK is unable to connect to flagsmith when trying to call update environment. Still I would expect some logical error instead of this |
I believe we're not handling this case correctly, where the API responds with a non-JSON 4xx-5xx response: flagsmith-go-client/internal/flaghttp/request.go Lines 150 to 152 in ad6f7fe
There's probably no need to unmarshal JSON at all here and we can just return the status code as an error, which is what we're trying to do here anyway: flagsmith-go-client/internal/flaghttp/request.go Lines 161 to 165 in ad6f7fe
|
@nishant-shah-social Are you able to reproduce this same error with the latest 3.6.0? You should be able to see more details now on what's going wrong. |
Intermittently getting following errors after upgrading to the golang client sdk version 3.5.0:-
Failed to update environment: invalid character '<' looking for beginning of value
"Failed to update environment: invalid character 'E' looking for beginning of value"
Any help will be highly appreciated
Thanks!
The text was updated successfully, but these errors were encountered: