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: Defunct process following exception in refresh.git.fetch #5400

Open
BeArchiTek opened this issue Jan 8, 2025 · 0 comments
Open

bug: Defunct process following exception in refresh.git.fetch #5400

BeArchiTek opened this issue Jan 8, 2025 · 0 comments
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/backlog This issue is part of the backlog type/bug Something isn't working as expected
Milestone

Comments

@BeArchiTek
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

1.1.0

Current Behavior

When the refresh.git.fetch task fails due to an exception, prefect does not properly reap the process.

An example of an exception :

2025-01-07T15:39:27.106953Z [error    ] Encountered exception during execution: RepositoryError("\n  stderr: 'fatal: unable to access 'https://github.com/opsmill/test-bkr.git/': Could not resolve host: github.com'") [prefect.flow_runs] routing_key=refresh.git.fetch
Traceback (most recent call last):
  File "/source/community/backend/infrahub/git/base.py", line 637, in fetch
    repo.remotes.origin.fetch()
  File "/usr/local/lib/python3.12/site-packages/git/remote.py", line 1069, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/remote.py", line 895, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 834, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git fetch -v -- origin
  stderr: 'fatal: unable to access 'https://github.com/opsmill/test-bkr.git/': Could not resolve host: github.com'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/prefect/flow_engine.py", line 655, in run_context
    yield self
  File "/usr/local/lib/python3.12/site-packages/prefect/flow_engine.py", line 718, in run_flow_async
    await engine.call_flow_fn()
  File "/usr/local/lib/python3.12/site-packages/prefect/flow_engine.py", line 673, in _call_flow_fn
    result = await call_with_parameters(self.flow.fn, self.parameters)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/community/backend/infrahub/message_bus/operations/git/repository.py", line 56, in fetch
    await repo.fetch()
  File "/source/community/backend/infrahub/git/base.py", line 639, in fetch
    self._raise_enriched_error(error=exc)
  File "/source/community/backend/infrahub/git/base.py", line 826, in _raise_enriched_error
    self._raise_enriched_error_static(
  File "/source/community/backend/infrahub/git/base.py", line 870, in _raise_enriched_error_static
    raise RepositoryError(identifier=name, message=error.stderr) from error
infrahub.exceptions.RepositoryError: 
  stderr: 'fatal: unable to access 'https://github.com/opsmill/test-bkr.git/': Could not resolve host: github.com'
2025-01-07T15:39:27.146637Z [error    ] Finished in state Failed("Flow run encountered an exception: RepositoryError: \n  stderr: 'fatal: unable to access 'https://github.com/opsmill/test-bkr.git/': Could not resolve host: github.com'") [prefect.flow_runs] routing_key=refresh.git.fetch

Process on the docker host :

 ps aux | grep git
ubuntu    761396  0.0  0.0      0     0 pts/0    Z+   09:49   0:00 [git] <defunct>
ubuntu    768906  0.0  0.0      0     0 pts/0    Z+   09:53   0:00 [git] <defunct>
ubuntu    771666  0.0  0.0   7020  4092 pts/0    S+   09:54   0:00 git cat-file --batch-check
ubuntu    775104  0.0  0.0   7020  1160 pts/0    S+   09:56   0:00 git cat-file --batch-check
ubuntu    783611  0.0  0.0      0     0 pts/0    Z+   10:00   0:00 [git] <defunct>
ubuntu    789219  0.0  0.0      0     0 pts/0    Z+   10:03   0:00 [git] <defunct>
ubuntu    791542  0.0  0.0      0     0 pts/0    Z+   10:04   0:00 [git] <defunct>
ubuntu    794764  0.0  0.0      0     0 pts/0    Z+   10:05   0:00 [git] <defunct>
ubuntu    797013  0.0  0.0      0     0 pts/0    Z+   10:07   0:00 [git] <defunct>
ubuntu    806870  0.0  0.0      0     0 pts/0    Z+   10:12   0:00 [git] <defunct>
ubuntu    809163  0.0  0.0      0     0 pts/0    Z+   10:13   0:00 [git] <defunct>

Expected Behavior

The processes should not end up defunct

Steps to Reproduce

/

Additional Information

No response

@BeArchiTek BeArchiTek added the type/bug Something isn't working as expected label Jan 8, 2025
@dgarros dgarros added the group/backend Issue related to the backend (API Server, Git Agent) label Jan 9, 2025
@dgarros dgarros added this to the Backlog milestone Jan 9, 2025
@dgarros dgarros added the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Jan 9, 2025
@exalate-issue-sync exalate-issue-sync bot removed this from the Backlog milestone Jan 9, 2025
@exalate-issue-sync exalate-issue-sync bot removed the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Jan 9, 2025
@exalate-issue-sync exalate-issue-sync bot added this to the Backlog milestone Jan 9, 2025
@exalate-issue-sync exalate-issue-sync bot added priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/backlog This issue is part of the backlog and removed state/needs-triage labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/backlog This issue is part of the backlog type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants