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

[Bug] CYGWIN error in ubuntu #187

Closed
nph4 opened this issue Sep 13, 2023 · 2 comments · Fixed by #188
Closed

[Bug] CYGWIN error in ubuntu #187

nph4 opened this issue Sep 13, 2023 · 2 comments · Fixed by #188
Assignees
Labels
bug Something isn't working

Comments

@nph4
Copy link

nph4 commented Sep 13, 2023

Description of Issue

[2023-09-13 02:21:29,926 DEBUG] [git.util.util.is_cygwin_git] Failed checking if running in CYGWIN due to: FileNotFoundError(2, 'No such file or directory')

Traceback (most recent call last):
File "/app/main.py", line 271, in
up_to_date = check_for_updates(options.get("auto_run", False))
File "/app/utils/report_tools.py", line 257, in check_for_updates
[tag_ref for tag_ref in project_repo.tags if hasattr(tag_ref.tag, "tagged_date")],
File "/app/utils/report_tools.py", line 257, in
[tag_ref for tag_ref in project_repo.tags if hasattr(tag_ref.tag, "tagged_date")],
File "/usr/local/lib/python3.10/site-packages/git/refs/tag.py", line 63, in tag
obj = self.object
File "/usr/local/lib/python3.10/site-packages/git/refs/tag.py", line 74, in object
return Reference._get_object(self)
File "/usr/local/lib/python3.10/site-packages/git/refs/symbolic.py", line 219, in _get_object
return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
File "/usr/local/lib/python3.10/site-packages/git/objects/base.py", line 94, in new_from_sha
oinfo = repo.odb.info(sha1)
File "/usr/local/lib/python3.10/site-packages/git/db.py", line 40, in info
hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha))
File "/usr/local/lib/python3.10/site-packages/git/cmd.py", line 1338, in get_object_header
return self.__get_object_header(cmd, ref)
File "/usr/local/lib/python3.10/site-packages/git/cmd.py", line 1325, in __get_object_header
return self._parse_object_header(cmd.stdout.readline())
File "/usr/local/lib/python3.10/site-packages/git/cmd.py", line 1284, in _parse_object_header
raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))
ValueError: SHA could not be resolved, git returned: b''

Additional Information as Applicable

Fantasy Football Platform

ESPN

League ID

629036893

Operating System

Linux
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

Other

Any other setup/environment/configuration information you might deem potentially relevant.

@nph4 nph4 added the bug Something isn't working label Sep 13, 2023
@nph4
Copy link
Author

nph4 commented Sep 13, 2023

More Info

Docker version
24.0.5, build ced0996

Base system Python version:
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux

Container Python version:
Python 3.10.6 (main, Aug 23 2022, 08:25:41) [GCC 10.2.1 20210110] on linux

@uberfastman
Copy link
Owner

uberfastman commented Sep 18, 2023

@nph4 I did some testing, and it turns out this was happening because under the hood, GitPython was trying to check if the system was on windows using the wrong path to uname, as it defaults to the location of the git installation, which in the Docker image I was using was in /usr/bin, but uname is located in /bin, so it was throwing this error. The fix for this is included in #188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants