Skip to content

Github token not working #697

@efirvida

Description

@efirvida

Hi!
I'm trying to integrate my EasyBuild with GitHub, but I always receive a:

ERROR: Token validation failed, not installing it. Please verify your token and try again.

I check the log file:

== 2021-04-29 12:29:07,586 build_log.py:227 INFO This is EasyBuild 4.3.3 (framework: 4.3.3, easyblocks: 4.3.3) on host Naboo.
== 2021-04-29 12:29:07,616 build_log.py:230 INFO Command line: --buildpath='/home/eb/build' --containerpath='/home/eb/containers' --github-user='efirvida' --install-github-token --installpath='/home/eb' --packagepath='/home/eb/packages' --prefix='/home/eb' --repositorypath='/home/eb/ebfiles_repo' --sourcepath='/home/eb/sources'
== 2021-04-29 12:29:07,617 build_log.py:232 INFO Using /tmp/eb-zvw3_uqv as temporary directory
== 2021-04-29 12:29:07,618 robot.py:58 INFO Using robot path(s): ['/home/eb/software/EasyBuild/4.3.3/easybuild/easyconfigs']
== 2021-04-29 12:29:07,618 options.py:1649 INFO Using default external modules metadata cfg files: ['/home/eb/software/EasyBuild/4.3.3/etc/cray_external_modules_metadata.cfg', '/home/eb/software/EasyBuild/4.3.3/etc/ohpc_external_modules_metadata.cfg']
== 2021-04-29 12:29:07,627 systemtools.py:879 INFO Found Python version 3.9
== 2021-04-29 12:29:07,627 systemtools.py:899 INFO Running EasyBuild with Python 3 (version 3.9)
== 2021-04-29 12:29:07,627 filetools.py:2426 INFO /tmp/fake_vsc_3auh_rnq moved to /tmp/eb-zvw3_uqv/fake_vsc_3auh_rnq
== 2021-04-29 12:29:07,627 hooks.py:111 INFO No location for hooks implementation provided, no hooks defined
== 2021-04-29 12:29:07,627 hooks.py:142 INFO Defined hooks verified, all known hooks: 
== 2021-04-29 12:29:07,627 environment.py:91 INFO Environment variable LMOD_QUIET set to 1 (previously undefined)
== 2021-04-29 12:29:07,627 environment.py:91 INFO Environment variable LMOD_IGNORE_CACHE set to 1 (previously undefined)
== 2021-04-29 12:29:07,627 environment.py:91 INFO Environment variable LMOD_REDIRECT set to no (previously undefined)
== 2021-04-29 12:29:07,627 environment.py:91 INFO Environment variable LMOD_EXTENDED_DEFAULT set to no (previously undefined)
== 2021-04-29 12:29:07,628 modules.py:291 INFO Full path for Lmod command is /usr/share/lmod/lmod/libexec/lmod, so using it
== 2021-04-29 12:29:07,628 modules.py:435 INFO Prepended list of module paths with path used by EasyBuild: /home/eb/modules/all
== 2021-04-29 12:29:07,628 run.py:222 INFO running cmd: type module 
== 2021-04-29 12:29:07,658 modules.py:232 INFO Found Lmod version 8.4.23
== 2021-04-29 12:29:07,658 modules.py:240 INFO Converted actual version to '8.4.23'
== 2021-04-29 12:29:07,810 github.py:2083 WARNING Failed to obtain GitHub token for efirvida
Use the following procedure to install a GitHub token in your keyring:
$ python -c 'import getpass, keyring; keyring.set_password("github_token", "efirvida", getpass.getpass())'
== 2021-04-29 12:29:19,872 github.py:2142 WARNING Sanity check on token failed; token doesn't match pattern '^[0-9a-f]{40}'
== 2021-04-29 12:29:20,640 github.py:2153 INFO GitHub token can be used for authenticated GitHub access, validation passed
== 2021-04-29 12:29:20,642 build_log.py:169 ERROR EasyBuild crashed with an error (at easybuild/base/exceptions.py:124 in __init__): Token validation failed, not installing it. Please verify your token and try again. (at easybuild/tools/github.py:2122 in install_github_token)

But seems that the token never match the pattern no matter what I use to paste it.

I also try to install it in the keyring using this:
python -c 'import getpass, keyring; keyring.set_password("github_token", "efirvida", "MY_TOKEN")'

but when I try to check the integration it fails too:

$ eb --check-github
== Temporary log file in case of crash /tmp/eb-06ndpo45/easybuild-846_yqqk.log

Checking status of GitHub integration...

Making sure we're online...OK

* GitHub user...efirvida => OK
* GitHub token...ghp..UVT (len: 40) => FAIL (validation failed)
* git command...OK ("git version 2.31.1; ")
* GitPython module...OK (GitPython version 3.1.14)

* push access to efirvida/easybuild-easyconfigs repo @ GitHub...FAIL (unexpected exception: 'Checking out branch \'main\' from [email protected]:efirvida/easybuild-easyconfigs.git failed: "Failed to fetch branch \'main\' from [email protected]:efirvida/easybuild-easyconfigs.git: Cmd(\'git\') failed due to: exit code(128)\\n  cmdline: git fetch -v pr_target_account_efirvida_kWdqy\\n  stderr: \'fatal: Could not read from remote repository.\\n\\nPlease make sure you have the correct access rights\\nand the repository exists.\'"')
* creating gists...OK
* location to Git working dirs... not found (suboptimal)

One or more checks FAILed, GitHub configuration not fully complete!
See http://easybuild.readthedocs.org/en/latest/Integration_with_GitHub.html#configuration for help.

Status of GitHub integration:
* --from-pr: OK
* --new-pr: not supported
* --review-pr: OK
* --update-pr: not supported
* --upload-test-report: not supported

I was thinking that may be an error with my token or my access but I test it using PyGithub and it works just fine, so I don't know where is the problem.

Thank in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions