Skip to content
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

oca-github-login failing #489

Open
pniederlag opened this issue Dec 26, 2020 · 7 comments
Open

oca-github-login failing #489

pniederlag opened this issue Dec 26, 2020 · 7 comments

Comments

@pniederlag
Copy link
Member

Steps to reproduce

  1. reading readme in order to get involved
  2. git clone and pipx install ./maintainer-tools
  3. start with oca-github-login pniederlag

Current behavior

Two-Factor-Auth is enabled on my account

oca-github-login pniederlag
Password for pniederlag: 
Traceback (most recent call last):
  File "/home/pn/.local/bin/oca-github-login", line 8, in <module>
    sys.exit(main())
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 78, in main
    authorize_token(args.username)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 54, in authorize_token
    two_factor_callback=two_factor_prompt)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 29, in deprecation_wrapper
    return func(*args, **kwargs)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 72, in authorize
    username, password, scopes, note, note_url, client_id, client_secret
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/github.py", line 503, in authorize
    json = self._json(self._post(url, data=data), 201)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.NotFoundError: 404 Not Found

### Expected behavior

- token is added

### Workaround

- run python tools/config.py creates a oca.cfg in current directory
- create token with necessary permissions on personal github account
- Add github username and token in oca.cfg
@simahawk
Copy link
Contributor

the workaround works for me as well. Can you propose a PR to include this in the readme?

@NL66278
Copy link
Contributor

NL66278 commented May 9, 2022

The workaround also worked for this problem:

$ oca-github-login NL66278
Password for NL66278: 
Traceback (most recent call last):
  File "/home/openeyedev/run/odoo-15.0/bin/oca-github-login", line 11, in <module>
    load_entry_point('oca-maintainers-tools==0.1.dev1062+g7d8a9f9', 'console_scripts', 'oca-github-login')()
  File "/home/openeyedev/run/odoo-15.0/lib/python3.9/site-packages/oca_maintainers_tools-0.1.dev1062+g7d8a9f9-py3.9.egg/tools/github_login.py", line 78, in main
    authorize_token(args.username)
  File "/home/openeyedev/run/odoo-15.0/lib/python3.9/site-packages/oca_maintainers_tools-0.1.dev1062+g7d8a9f9-py3.9.egg/tools/github_login.py", line 53, in authorize_token
    auth = github3.authorize(user, password, scopes, note, note_url,
AttributeError: module 'github3' has no attribute 'authorize

@simahawk
Copy link
Contributor

simahawk commented May 9, 2022

I think I ended up pinning an old version and the forgot to report here.... wait

@simahawk
Copy link
Contributor

simahawk commented May 9, 2022

Last version that worked for me was 1.4.0 I think.
A bit of history here #446

@bealdav
Copy link
Member

bealdav commented Nov 28, 2022

I also fail in

    auth = github3.authorize(user, password, scopes, note, note_url,
AttributeError: module 'github3' has no attribute 'authorize

What is the fallback to get oca-github-login working.

Do you know which commit ?
Thanks

@ilyasProgrammer
Copy link
Member

ilyasProgrammer commented Apr 13, 2023

I have same issue. 404 or module 'github3' has no attribute 'authorize. Depend on version.
What access rights need to enable for token ?

@simahawk
Copy link
Contributor

GH lib api changed a lot, we should update/refactor/trash things here. If you have time, any contrib is welcomed ;)
Meanwhile, workaround: use a token and run export GITHUB_TOKEN=xyz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants