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

App fails to start when Git binary is not present #2125

Closed
der-eismann opened this issue Dec 30, 2023 · 5 comments · Fixed by #2126
Closed

App fails to start when Git binary is not present #2125

der-eismann opened this issue Dec 30, 2023 · 5 comments · Fixed by #2126
Assignees
Labels
bug python Pull requests that update Python code Staged Feature Complete and in Testing for Next Release
Milestone

Comments

@der-eismann
Copy link
Contributor

Please complete the following information:

  • Version: 5.10.0
  • OS: Linux with Flatpak

Describe the bug
When testing flathub/io.edcd.EDMarketConnector#32, I get the following error:

Traceback (most recent call last):
  File "/app/edmarketconnector/EDMarketConnector.py", line 61, in <module>
    import killswitch
  File "/app/edmarketconnector/killswitch.py", line 20, in <module>
    import config
  File "/app/edmarketconnector/config/__init__.py", line 149, in <module>
    user_agent = f'EDCD-{appname}-{appversion()}'
                                   ^^^^^^^^^^^^
  File "/app/edmarketconnector/config/__init__.py", line 141, in appversion
    shorthash = git_shorthash_from_head()
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/edmarketconnector/config/__init__.py", line 95, in git_shorthash_from_head
    git_cmd = subprocess.Popen(
              ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'

I guess this was introduced in #2084 when the exception was modified, but I'm not 100% sure. Now most people do have Git, but it shouldn't be a hard requirement, especially if there's a fallback to the .gitversion file.
/cc @dvdmuckle

To Reproduce
Steps to reproduce the behavior:

  1. Download .tar.gz archive
  2. Uninstall Git
  3. Try to run app

Expected behavior
App should start

@Rixxan
Copy link
Contributor

Rixxan commented Dec 30, 2023

Confirmed and fix in testing. Looks like also handling a FileNotFound error here would fix.

@Rixxan Rixxan self-assigned this Dec 30, 2023
@Rixxan Rixxan added python Pull requests that update Python code and removed unconfirmed An unconfirmed bug labels Dec 30, 2023
@Rixxan Rixxan added this to the 5.10.1 milestone Dec 30, 2023
@Rixxan
Copy link
Contributor

Rixxan commented Dec 30, 2023

PR 2126 opened to fix. Will be included in 5.10.1 in early Jan.

@Rixxan Rixxan linked a pull request Dec 30, 2023 that will close this issue
@Rixxan
Copy link
Contributor

Rixxan commented Dec 30, 2023

@der-eismann, can you possibly double-check for me that updating this line

except subprocess.CalledProcessError as e:

to this

except (subprocess.CalledProcessError, FileNotFoundError) as e:

Also resolves the issue on your flatpak tester? I'm testing it here but want to make sure there isn't another issue this is masking.

@der-eismann
Copy link
Contributor Author

der-eismann commented Dec 30, 2023

Seems to work fine, I can run it after applying this change 👍 Will merge it now and remove it after 5.10.1 is out. Although I'm wondering why there's no Couldn't run git command for short hash log message appearing 🤔

@Rixxan
Copy link
Contributor

Rixxan commented Dec 31, 2023

Hmm. Possibly depending on how the logging is set up? I'd have to refresh myself on logging levels.

Glad to hear it's working now!!

@Rixxan Rixxan added the Staged Feature Complete and in Testing for Next Release label Jan 3, 2024
@Rixxan Rixxan closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug python Pull requests that update Python code Staged Feature Complete and in Testing for Next Release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants