Skip to content

TravisError: [200] while using github_auth with PRIVATE url #60

@iamurri

Description

@iamurri

I'm using travispy to create a discord bot that my dev team can interact with to manage their builds,
for this I need to access two github repositories that are private, but upon calling github_auth with a token that I tested on my public repositories and the PRIVATE url, I get this error:

Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\Antoine\PycharmProjects\Travis-Build-Logger\venv\lib\site-packages\travispy\_helpers.py", line 19, in get_response_contents
    contents = response.json()
  File "C:\Users\Antoine\PycharmProjects\Travis-Build-Logger\venv\lib\site-packages\requests\models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\Antoine\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Antoine\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Antoine\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Antoine\PycharmProjects\Travis-Build-Logger\venv\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "C:/Users/Antoine/PycharmProjects/Travis-Build-Logger/TBL.py", line 29, in on_message
    t = TravisPy.github_auth(TRAVIS_TOKEN, travispy.travispy.PRIVATE)
  File "C:\Users\Antoine\PycharmProjects\Travis-Build-Logger\venv\lib\site-packages\travispy\travispy.py", line 77, in github_auth
    contents = get_response_contents(response)
  File "C:\Users\Antoine\PycharmProjects\Travis-Build-Logger\venv\lib\site-packages\travispy\_helpers.py", line 34, in get_response_contents
    raise TravisError(contents)
travispy.errors.TravisError: [200] <!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Travis CI - Test and Deploy with Confidence</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" href="https://cdn.travis-ci.com/images/favicon-076a22660830dc325cc8ed70e7146a59.png" />

    
<meta name="travis/config/environment" content="%7B%22modulePrefix%22:%22travis%22,%22environment%22:%22production%22,%22rootURL%22:%22/%22,%22locationType%22:%22auto%22,%22defaultTitle%22:%22Travis%20CI%20-%20Test%20and%20Deploy%20with%20Confidence%22,%22EmberENV%22:%7B%22FEATURES%22:%7B%7D,%22EXTEND_PROTOTYPES%22:%7B%22Date%22:false%7D,%22ENABLE_DS_FILTER%22:true%7D,%22APP%22:%7B%22name%22:%22travis%22,%22version%22:%220.0.0%22%7D,%22apiEndpoint%22:%22https://api.travis-ci.com%22,%22sourceEndpoint%22:%22https://github.com%22,%22pusher%22:%7B%22key%22:%2259236bc0716a551eab40%22,%22host%22:%22ws.pusherapp.com%22,%22debug%22:false,%22channelPrefix%22:%22private-%22,%22encrypted%22:true%7D,%22urls%22:%7B%22about%22:%22https://about.travis-ci.com%22,%22blog%22:%22https://blog.travis-ci.com%22,%22docs%22:%22https://docs.travis-ci.com%22,%22status%22:%22https://www.traviscistatus.com/%22,%22imprint%22:%22https://billing.travis-ci.com/pages/imprint%22,%22enterprise%22:%22https://enterprise.travis-ci.com%22,%22twitter%22:%22https://twitter.com/travisci%22,%22jobs%22:%22https://travisci.workable.com/%22,%22support%22:%22mailto:support@travis-ci.com%22,%22legal%22:%22https://billing.travis-ci.com/pages/legal%22,%22security%22:%22https://billing.travis-ci.com/pages/security%22,%22terms%22:%22https://billing.travis-ci.com/pages/terms%22%7D,%22endpoints%22:%7B%22sshKey%22:%22true%22,%22caches%22:%22true%22%7D,%22timing%22:%7B%22syncingPageRedirectionTime%22:5000%7D,%22intervals%22:%7B%22updateTimes%22:1000,%22branchCreatedSyncDelay%22:2000,%22repositorySearchDebounceRate%22:500,%22triggerBuildRequestDelay%22:3000,%22fetchRecordsForPusherUpdatesThrottle%22:1000,%22repositoryFilteringDebounceRate%22:200,%22syncingPolling%22:3000%7D,%22githubOrgsOauthAccessSettingsUrl%22:%22https://github.com/settings/connections/applications/88c5b97de2dbfc50f3ac%22,%22apiTraceEndpoint%22:%22https://papertrailapp.com/systems/travis-com-api-production/events?q=program%253Aapp%252Fweb%2520log-tracing%2520%22,%22ajaxPolling%22:false,%22logLimit%22:10000,%22emojiPrepend%22:%22%22,%22statusPageStatusUrl%22:%22https://pnpcptp8xh9k.statuspage.io/api/v2/status.json%22,%22randomiseTeam%22:true,%22featureFlags%22:%7B%22repository-filtering%22:true,%22debug-logging%22:false,%22landing-page-cta%22:true,%22show-running-jobs-in-sidebar%22:false,%22debug-builds%22:false,%22broadcasts%22:true,%22pro-version%22:true%7D,%22pro%22:true,%22pagination%22:%7B%22dashboardReposPerPage%22:25,%22profileReposPerPage%22:25%7D,%22sentry%22:%7B%22development%22:true%7D,%22pagesEndpoint%22:%22https://billing.travis-ci.com%22,%22billingEndpoint%22:%22https://billing.travis-ci.com%22,%22userlike%22:true,%22beacon%22:true,%22release%22:%22a7a0c74cc%22,%22contentSecurityPolicyRaw%22:%7B%22default-src%22:%22'none'%22,%22script-src%22:%22'self'%20https://ssl.google-analytics.com%20https://djtflbt20bdde.cloudfront.net/%20https://js.pusher.com%22,%22font-src%22:%22'self'%20https://fonts.googleapis.com/css%20https://fonts.gstatic.com%22,%22connect-src%22:%22'self'%20ws://ws.pusherapp.com%20wss://ws.pusherapp.com%20https://*.pusher.com%20https://s3.amazonaws.com/archive.travis-ci.com/%20https://s3.amazonaws.com/archive.travis-ci.org/%20app.getsentry.com%20https://pnpcptp8xh9k.statuspage.io/%20https://ssl.google-analytics.com%22,%22img-src%22:%22'self'%20data:%20https://www.gravatar.com%20http://www.gravatar.com%20app.getsentry.com%20https://*.githubusercontent.com%20https://0.gravatar.com%20https://ssl.google-analytics.com%22,%22style-src%22:%22'self'%20https://fonts.googleapis.com%20'unsafe-inline'%20https://djtflbt20bdde.cloudfront.net%22,%22media-src%22:%22'self'%22,%22frame-src%22:%22'self'%20https://djtflbt20bdde.cloudfront.net%22,%22report-uri%22:%22https://65f53bfdfd3d7855b8bb3bf31c0d1b7c.report-uri.io/r/default/csp/reportOnly%22,%22block-all-mixed-content%22:%22%22,%22form-action%22:%22'self'%22,%22frame-ancestors%22:%22'none'%22,%22object-src%22:%22https://djtflbt20bdde.cloudfront.net%22%7D,%22cspSectionsWithApiHost%22:[%22connect-src%22,%22img-src%22],%22contentSecurityPolicy%22:%7B%22default-src%22:%22'none'%22,%22script-src%22:%22'self'%20https://ssl.google-analytics.com%20https://djtflbt20bdde.cloudfront.net/%20https://js.pusher.com%22,%22font-src%22:%22'self'%20https://fonts.googleapis.com/css%20https://fonts.gstatic.com%22,%22connect-src%22:%22'self'%20ws://ws.pusherapp.com%20wss://ws.pusherapp.com%20https://*.pusher.com%20https://s3.amazonaws.com/archive.travis-ci.com/%20https://s3.amazonaws.com/archive.travis-ci.org/%20app.getsentry.com%20https://pnpcptp8xh9k.statuspage.io/%20https://ssl.google-analytics.com%20https://api.travis-ci.com%22,%22img-src%22:%22'self'%20data:%20https://www.gravatar.com%20http://www.gravatar.com%20app.getsentry.com%20https://*.githubusercontent.com%20https://0.gravatar.com%20https://ssl.google-analytics.com%20https://api.travis-ci.com%22,%22style-src%22:%22'self'%20https://fonts.googleapis.com%20'unsafe-inline'%20https://djtflbt20bdde.cloudfront.net%22,%22media-src%22:%22'self'%22,%22frame-src%22:%22'self'%20https://djtflbt20bdde.cloudfront.net%22,%22report-uri%22:%22https://65f53bfdfd3d7855b8bb3bf31c0d1b7c.report-uri.io/r/default/csp/reportOnly%22,%22block-all-mixed-content%22:%22%22,%22form-action%22:%22'self'%22,%22frame-ancestors%22:%22'none'%22,%22object-src%22:%22https://djtflbt20bdde.cloudfront.net%22%7D,%22contentSecurityPolicyMeta%22:false,%22contentSecurityPolicyHeader%22:%22Content-Security-Policy-Report-Only%22,%22ember-cli-mirage%22:%7B%22usingProxy%22:false,%22useDefaultPassthroughs%22:true%7D,%22exportApplicationGlobal%22:false,%22ember-modal-dialog%22:%7B%22hasEmberTether%22:%221.0.0-beta.0%22%7D,%22gaCode%22:%22UA-24868285-5%22%7D" />

    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Cousine:400,400i,700,700i" rel="stylesheet" type="text/css">
    <link integrity="" rel="stylesheet" href="https://cdn.travis-ci.com/assets/vendor-a81eb41c5ee4febe579413f3471371cd.css">
    <link integrity="" rel="stylesheet" href="https://cdn.travis-ci.com/assets/travis-09e9fd719935bc7b2bb8737be7f1608b.css">
    <link rel="mask-icon" href="https://cdn.travis-ci.com/images/favicon-c566132d45ab1a9bcae64d8d90e4378a.svg" color="black">

    
  </head>
  <body>
    <noscript>
      <div style="width: 60%; margin: auto;">
        <img src="/images/logos/TravisCI-Mascot-1.png" alt="Travis CI mascot" width="200" style="float: left; margin: 1em 3em;">
        <div>
          <h1>Hey there!</h1>
          <p>Looks like you have JavaScript disabled.</p>
          <p>The Travis CI webclient needs JavaScript to work properly.</p>
          <h2>Please enable JavaScript to get the best Travis CI experience.</h2>
          <h3>Thank you!</h3>
        </div>
      </div>
    </noscript>
    

    <script src="https://cdn.travis-ci.com/assets/vendor-c9c51d2de6ae1c3e6b2d08eab59c92f8.js"></script>
    <script src="https://cdn.travis-ci.com/assets/travis-a50dbdf6462ba3370273320bfbac7921.js"></script>

    

  </body>
</html>

Any idea what I might have done wrong ?
Thanks in advance (if you need to see the source code just ask :) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions