Giter Club home page Giter Club logo

Comments (15)

suxur avatar suxur commented on September 24, 2024 5

@Rubix982 I was able to login with 2FA by using a Github Personal access token and passing it via

travis login --com --github-token TOKEN

from travis.rb.

BanzaiMan avatar BanzaiMan commented on September 24, 2024 2

See #788 (comment) for an interim workaround.

from travis.rb.

Rubix982 avatar Rubix982 commented on September 24, 2024 1

Hello!

I'm running into the same set of issues.

I realized that I have 2FA activated for my account, and the way that the travis login handles api.github.com is through an HTTPS endpoint.

This error also occurs to me when I try to push to a GitHub repository with the remote set to HTTPS instead of my SSH keys. That is to say, due to the recent changes that Github wants to deprecate the git CLI for the simple HTTPS login feature, in favor of the permission key generated as per security grants on the repository

It would be a better move to let us, and a possible solution as well to circumvent this, that we could somehow feed travis login the SSH file key that is authenticated against the account for login verification.

Another partial helping method would be to generate a more helpful error message that lets the user know whether the error was due to the 2FA issue, or something else. Currently, the error logs generated are not helpful to trace the problem too.

For the record, one of the current options available via --help was sshkey, but I'm assuming this has something to do with a .travis.yml at root and pushing config files, but a pre-requisite to that is login, which is a blocker to all the other options at the moment.

from travis.rb.

SturmB avatar SturmB commented on September 24, 2024 1

I was able to fix my issue by changing the repository endpoints in my ~/.travis/config.yml file.

I had recently started using travis-ci.com instead of travis-ci.org (since the latter is shutting down), but the CLI needs to know that, too. So in the aforementioned config file, under repos/<repo-name>/endpoint, I changed them all from https://api.travis-ci.org/ to https://api.travis-ci.com/.

Note that I still needed to do this even though I had already changed the default_endpoint to https://api.travis-ci.com/.

from travis.rb.

kangshuaifunotkangshifu avatar kangshuaifunotkangshifu commented on September 24, 2024 1

travis login --com --github-token TOKEN

i can't appreciate you any more! i succeed in logining in by token successfully,but i still fail to login in by my username and password.

from travis.rb.

aungkpaing avatar aungkpaing commented on September 24, 2024 1

+1. Broken for me as well. I can't do ssh --generate because of it

from travis.rb.

alvin0216 avatar alvin0216 commented on September 24, 2024

I also encountered the same problem...

System
Ruby:                     Ruby 2.6.3-p62
Operating System:         Mac OS X 10.15.4
RubyGems:                 RubyGems 3.0.3

CLI
Version:                  1.10.0
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2021-01-13 19:46:34 +0800

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                as "alvin0216"
Verify SSL:               yes
Enterprise:               no

Endpoints
com:                      https://api.travis-ci.com/ (access token, default, current)
org:                      https://api.travis-ci.org/ ()

Last Exception
An error occurred running `travis login --pro`:
    RuntimeError: Not Found
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:212:in `rescue in basic_auth'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:208:in `basic_auth'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:216:in `login'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:81:in `possible_tokens'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:50:in `each_token'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/tools/github.rb:37:in `with_token'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/cli/login.rb:31:in `login'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/cli/login.rb:50:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/cli/command.rb:200:in `execute'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/lib/travis/cli.rb:64:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/travis-1.10.0/bin/travis:18:in `<top (required)>'
        from /usr/local/bin/travis:23:in `load'
        from /usr/local/bin/travis:23:in `<main>'

Even though I took this approach

from travis.rb.

AlFontal avatar AlFontal commented on September 24, 2024

I am facing the same issue:

System
Ruby:                     Ruby 2.7.0-p0
Operating System:         Pop 20.04
RubyGems:                 RubyGems 3.1.2

CLI
Version:                  1.10.0
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2021-01-15 10:21:46 +0100

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                no
Verify SSL:               yes
Enterprise:               no

Endpoints
com:                      https://api.travis-ci.com/ (current)

Last Exception
An error occurred running `travis login --pro`:
    RuntimeError: Not Found
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:212:in `rescue in basic_auth'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:208:in `basic_auth'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:216:in `login'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:81:in `possible_tokens'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:50:in `each_token'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:37:in `with_token'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/cli/login.rb:31:in `login'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/cli/login.rb:50:in `run'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/cli/command.rb:200:in `execute'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/lib/travis/cli.rb:64:in `run'
        from /home/alejandro/.gem/ruby/2.7.0/gems/travis-1.10.0/bin/travis:18:in `<top (required)>'
        from /home/alejandro/.gem/ruby/2.7.0/bin/travis:23:in `load'
        from /home/alejandro/.gem/ruby/2.7.0/bin/travis:23:in `<main>'

from travis.rb.

DudeNr33 avatar DudeNr33 commented on September 24, 2024

I have the same issue and can confirm that the workaround proposed by BanzaiMan worked for me.

System
Ruby:                     Ruby 2.7.2-p137
Operating System:         Windows
RubyGems:                 RubyGems 3.1.4

CLI
Version:                  1.10.0
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2021-01-17 09:01:17 +0100

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                no
Verify SSL:               yes
Enterprise:               no

Endpoints
com:                      https://api.travis-ci.com/ (current)

Last Exception
An error occurred running `travis login --pro`:
    RuntimeError: Not Found
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:212:in `rescue in basic_auth'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:208:in `basic_auth'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:216:in `login'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:81:in `possible_tokens'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:50:in `each_token'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/tools/github.rb:37:in `with_token'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/cli/login.rb:31:in `login'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/cli/login.rb:50:in `run'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/cli/command.rb:200:in `execute'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/lib/travis/cli.rb:64:in `run'
        from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/travis-1.10.0/bin/travis:18:in `<top (required)>'
        from C:/Ruby27-x64/bin/travis:23:in `load'
        from C:/Ruby27-x64/bin/travis:23:in `<main>'

from travis.rb.

SturmB avatar SturmB commented on September 24, 2024

I am also afflicted, and the workaround referenced by @BanzaiMan does not work (specifically, point no.2 in the referenced post). Unless, of course, I am doing it wrong.

System
Ruby:                     Ruby 3.0.0-p0
Operating System:         Ubuntu 20.04
RubyGems:                 RubyGems 3.2.3

CLI
Version:                  1.10.0
Plugins:                  none
Auto-Completion:          no
Last Version Check:       2021-02-12 09:20:36 -0500

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                no
Verify SSL:               yes
Enterprise:               no

Endpoints
org:                      https://api.travis-ci.org/ (access token)
com:                      https://api.travis-ci.com/ (default, current)

Last Exception
An error occurred running `travis login --pro`:
    RuntimeError: Not Found
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:212:in `rescue in basic_auth'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:208:in `basic_auth'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:216:in `login'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:81:in `possible_tokens'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:50:in `each_token'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/tools/github.rb:37:in `with_token'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/cli/login.rb:31:in `login'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/cli/login.rb:50:in `run'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/cli/command.rb:200:in `execute'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/lib/travis/cli.rb:64:in `run'
        from /home/sturm/.rvm/gems/ruby-3.0.0/gems/travis-1.10.1.travis.1341.9/bin/travis:18:in `<top (required)>'
        from /home/sturm/.rvm/gems/ruby-3.0.0/bin/travis:23:in `load'
        from /home/sturm/.rvm/gems/ruby-3.0.0/bin/travis:23:in `<main>'

from travis.rb.

Rubix982 avatar Rubix982 commented on September 24, 2024

Thanks for the update, @SturmB ! I'll get back to trying this in 2-3 days' time. Appreciate the feedback.

from travis.rb.

yelvert avatar yelvert commented on September 24, 2024

STILL BROKEN

from travis.rb.

SimonLammer avatar SimonLammer commented on September 24, 2024

still broken

from travis.rb.

ephraimilunga avatar ephraimilunga commented on September 24, 2024

@Rubix982 I was able to login with 2FA by using a Github Personal access token and passing it via

travis login --com --github-token TOKEN

This is the only solution that worked for me.

from travis.rb.

Rubix982 avatar Rubix982 commented on September 24, 2024

Finally! After 10 months, I can finally finish my Jenkins tutorial. Thanks, @ephraimilunga, @suxur!

from travis.rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.