-
Notifications
You must be signed in to change notification settings - Fork 29
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
unclear TravisError in get_response_contents when grabbing build log from Travis #58
Comments
Some more information: this is the actual error that occurs in
|
After a bit of debugging, I found a workaround, but no real fix yet... diff --git a/travispy/_helpers.py b/travispy/_helpers.py
index 348d816..f54636b 100644
--- a/travispy/_helpers.py
+++ b/travispy/_helpers.py
@@ -16,7 +16,10 @@ def get_response_contents(response):
'''
status_code = response.status_code
try:
- contents = response.json()
+ if 'json' in response.headers['content-type']:
+ contents = response.json()
+ else:
+ contents = {'log': {'type': 'Log', 'body': response.text}}
except:
error = response.text.strip()
if not error: The problem is that the log is provided as a value of type The return value of A dirty workaround is to manually construct the expected There must be a cleaner way to fix this though, at least only do this when the response is actually for a log, and not for something else that may be of type @menegazzo Any suggestions for a better way of dealing with this? |
Even my team is having the same issue. Is there a fix or a PR request already for this. The workaround seems to be a fix. We can send this as a pull request. @menegazzo Thanks for this awesome API! |
@SilleBille I don't think my proposed workaround is a proper fix, there must be a better way to fix this, but we'll need some input from @menegazzo on this I think... |
Updated: @boegel FYI, if you do |
Hey guys! Sorry for taking so long to get back to you. I will take a look at this right away and ASAP I bring some news. Thanks for your patience and support! |
@menegazzo if you are going to drop support for v2, my CI infrastructure will become unstable. I tried to install v3 Version but it gets installed only to the user who is installing it. I tried sudo pip3 install as well. Didn't work. Tried this:
The last step throws "Module not found error". I know this is not relevant to the bug but since you said you will be dropping v2 support, I am posting it here. Thanks for the heads up! |
@menegazzo @boegel Just wanted to update. I face the same issue in the pip3 package as well! Sorry for the wrong post above. Proof:
|
@menegazzo Any updates on this? |
Hi. Unfortunately I don't have the time to keep the support on this library. If you have the interest in taking the ownership of this, let me know. |
I've been using
travispy
for a long time now, has worked flawlessly for months.It started failing on me recently though, for reasons unclear to me (my best guess is a change in the Travis API for now).
Here's the traceback I'm seeing:
My
pr_check.py
script is available at https://github.com/boegel/eb-scripts/blob/master/pr_check.py .It fails when trying to grab the log from https://travis-ci.org/easybuilders/easybuild-easyconfigs/builds/340553691 .
Any ideas on what may be broken here?
The text was updated successfully, but these errors were encountered: