https://sentry.io/share/issue/312e333535313939393137/
UnsupportedResponseType: text/html; charset=utf-8
File "sentry_plugins/client.py", line 56, in from_response
raise UnsupportedResponseType(response.headers['Content-Type'], response.status_code)
File "sentry_plugins/client.py", line 140, in _request
return BaseApiResponse.from_response(resp)
File "sentry_plugins/client.py", line 205, in _request
*args, **kwargs)
File "sentry_plugins/vsts/client.py", line 26, in request
return self._request(method, path, headers=headers, data=data, params=params)
File "sentry_plugins/client.py", line 153, in patch
return self.request('PATCH', *args, **kwargs)
...
(3 additional frame(s) were not displayed)
text/html; charset=utf-8
I've still yet to determine exactly why its unhappy about this, as we seem to be doing everything correctly per the docs. Google'ing for this hasn't yield much help other than people having this issue on some microsoft services, which could simply be related to the webserver they use.
Struggling to repro again locally, but fixed a couple of more items here:
https://github.com/getsentry/sentry-plugins/pull/251
And improving the response handling (at least our assumptions) here:
I was seeing if there was anything I could potentially help with from my side. I thought I'd check the URL formats you are hitting (Projects and Work Items) and they both return valid data for my instance.
That's when I noticed a "my bad". As a typical user, I didn't read/understand the labels and entered this:

... where you were probably expecting this:

Using instance.visualstudio.com produces the text/html; charset=utf-8 error. Using just instance produces a different error:
An internal error occurred with the integration and the Sentry team has been notified
As a suggestion, perhaps the integration could do some form validation and prevent strings ending in .visualstudio.com.
It's actually expecting 'example.visualstudio.com'. If you put 'instance', then we would query 'https://instance/'.
Ah, good to know that I was right first time ;) Sorry about the diversion...
Just to share one other thing, VSTS allows you to query the Web API for projects by name or GUID. I tried changing the Sentry integration to use the project GUID but it didn't work.
@stajs So I've pushed out a few various improvements. I dont think its going to resolve anything, but can you try again and let me know if you're seeing this issue?
Still, got the charset error when linking. Is the Work Item ID expecting an integer? I'll re-add the identity to see if that affects anything...
Re-adding the identity didn't help.
Yeah linking is the issue # which is an integer. Will try to find someone at visual studio to help us figure out what鈥檚 going on at this point. I don鈥檛 actually even know how to reproduce it anymore, but I definitely hit this in some cases early in development.
Not ideal I know, but feel free to ping me if you want me to reproduce it.
You guys have got way more detail than I do, but perhaps I can throw out some thoughts to try reverse-rubber ducking. I'm definitely not attempting to teach you how to suck eggs here!
@stajs
Received a note to make sure we're using the application/json-patch+json. I mistakenly thought we had deployed the latest changes to sentry-plugins, and it turns out that we had an issue in our system that automatically bumps these revisions and it never happened. I'm going to get that out today.
@stajs mind giving it a shot now?
New problem:
You need to associate an identity with undefined before you can create issues with this service.

Before doing anything else, I double checked that I had an identity and I did:

I disconnected it, and then tried to Associate Identity under the error message (first screenshot). I followed the flow to VSTS and back to Sentry and confirmed that the Identity was showing up again under My Settings > Identities. I tried to Link with Existing Issue again but the new problem still shows.
@stajs to confirm, you're just getting a "Not Authenticated" problem?
Sorry, not understanding the question. I don't see any authentication problems...
If you mean with the Identity flow to VSTS, I can screenshot the flow:









The request to https://sentry.io/api/0/issues/{id}/plugins/vsts/link/ responds with a 400 Bad request:
{"error_type": "auth", "auth_url": "/account/settings/social/associate/visualstudio/"}
@stajs k so sounds like its still having the same issue. I'm going to rip out this 'handle the 203 like an unauthenticated request' code, as its clearly not correct.
What's the undefined part of the error message supposed to be?
@stajs Im also looking into that, but its simply an error message being reported incorrectly
@stajs can you confirm things are still problematic? I believe we might have 'fixed' the 203 error (it shouldnt show up anymore, at least to my understanding).
Sorry for the trouble. This would be a lot easier if we could repro it ourselves.
I can confirm: still problematic with text/html; charset=utf-8 error.
@stajs could you drop me an email with your account username (thats authenticated with VSTS) on sentry.io? (david at sentry.io). I'm going to try to debug what the exact error we're receiving is here.
Email sent.
@stajs I didn't see it come through.Mind trying again? You can also send it to dcramer at gmail
OK, tried your Gmail...
We've got a full response fixture now to work with thanks to @stajs.
For record keeping, the response is a 203 that resembles a login page
Visual Studio Team Services | Sign In
A smoking 馃敨 ...!
Ok it looks like our API client redirects by default, and the API endpoint is returning a 302.
I've redacted details, but the redirect looks like this:
https://app.vssps.visualstudio.com/_signin?realm=INSTANCE&reply_to=API_URL&redirect=1&force=1&context=CONTEXT#ctx=CONTEXT
Context seems to be base64 encoded, and isnt sensitive:
>>> base64.b64decode('eyJTaWduSW5Db29raWVEb21haW5zIjpbImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSIsImh0dHBzOi8vbG9naW4ubWljcm9zb2Z0b25saW5lLmNvbSJdfQ2==')
'{"SignInCookieDomains":["https://login.microsoftonline.com","https://login.microsoftonline.com"]}\r'
Sorry, not understanding the question. I don't see any authentication problems...
If you mean with the Identity flow to VSTS, I can screenshot the flow:
1. Disconnect the Visual Studio identity:   2. Link:  3. Associate identity:    4. Confirm identity:  5. Try linking again:  6. New problem: The request to
https://sentry.io/api/0/issues/{id}/plugins/vsts/link/responds with a400 Bad request:{"error_type": "auth", "auth_url": "/account/settings/social/associate/visualstudio/"}
I have the same problem with on-premise installation on Kubernetes, couldn't figure it out whatever I tried. Since this issue is still open, I guess there is no fix for it yet?
The old vsts plugin is now deprecated in favor of the new integration. They said I鈥檓 pretty sure these problems are resolved but likely not in whichever version of sentry you鈥檙e running.
The old vsts plugin is now deprecated in favor of the new integration. They said I鈥檓 pretty sure these problems are resolved but likely not in whichever version of sentry you鈥檙e running.
I am using the official docker image which is released 4 days ago.
@iboware im pretty sure thats not the current version of Sentry unless its actually building from source (which most people don't do)