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

Orphaned Files on Job Failure Break Future Jobs on self-hosted runners #14

Open
exp-hc opened this issue Nov 19, 2021 · 3 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@exp-hc
Copy link

exp-hc commented Nov 19, 2021

When an error occurs during execution, a collection is orphaned and breaks future runs until cleaned up manually. This is on a self-hosted runner which works fine until an error occurs.

The following snippet is from the failed job:

Run echo ::group::Extracting the collection metadata from "'galaxy.yml'"...
Extracting the collection metadata from 'galaxy.yml'...
Run import yaml
/home/github/actions-runner/_work/_temp/01dd8358-3030-4067-9a41-b4b8a3b66d60.py:5: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  collection_meta = yaml.load(galaxy_yml)
Run echo ::endgroup::

Run echo ::group::Move "'expedient.smc'" collection to ansible_collections/expedient/smc...
Move 'expedient.smc' collection to ansible_collections/expedient/smc...
Run set -x ; mkdir -pv "ansible_collections/expedient" ; mv -v ".tmp-ansible-collection-checkout" "ansible_collections/expedient/smc" ; set +x
+ mkdir -pv ansible_collections/expedient
+ mv -v .tmp-ansible-collection-checkout ansible_collections/expedient/smc
mv: cannot move '.tmp-ansible-collection-checkout' to 'ansible_collections/expedient/smc/.tmp-ansible-collection-checkout': Directory not empty
Error: Process completed with exit code 1.

Here is the original failure leading to the orphaned files

Installing collected packages: ansible-core
    Running setup.py install for ansible-core: started
    ERROR: Command errored out with exit status 1:
    Running setup.py install for ansible-core: finished with status 'error'
     command: /home/github/actions-runner/_work/_tool/Python/3.9.9/x64/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-042atxsa/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-042atxsa/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-anvypspo/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/github/.local/include/python3.9/ansible-core
         cwd: /tmp/pip-req-build-042atxsa/
    Complete output (27 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-042atxsa/setup.py", line 120, in <module>
        _validate_install_ansible_core()
      File "/tmp/pip-req-build-042atxsa/setup.py", line 91, in _validate_install_ansible_core
        raise RuntimeError(
    RuntimeError:
    
        ****************************************************************************
    
        Cannot install ansible-core with a pre-existing ansible-base==2.10.15.post0
        installation.
    
        Installing ansible-core with ansible-2.9 or older, or ansible-base-2.10
        currently installed with pip is known to cause problems. Please uninstall
        ansible-base and install the new version:
    
            pip uninstall ansible-base
            pip install ansible-core
    
        If you want to skip the conflict checks and manually resolve any issues
        afterwards, set the ANSIBLE_SKIP_CONFLICT_CHECK environment variable:
    
            ANSIBLE_SKIP_CONFLICT_CHECK=1 pip install ansible-core
    
        ****************************************************************************
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/github/actions-runner/_work/_tool/Python/3.9.9/x64/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-042atxsa/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-042atxsa/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-anvypspo/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/github/.local/include/python3.9/ansible-core Check the logs for full command output.
Error: Process completed with exit code 1.
@webknjaz
Copy link
Member

@exp-hc where is that install error comming from? This action? Or have you performed some of the installation procedures yourself?

@exp-hc
Copy link
Author

exp-hc commented Nov 22, 2021

@webknjaz The error was due to different version of ansible being installed locally, I'm using a self-hosted runner. Once I pip uninstalled ansible, the 'original failure' went away.

@webknjaz
Copy link
Member

Interesting... I suppose it'd be best for us to maintain our own virtualenv, then.

@webknjaz webknjaz added the bug Something isn't working label Nov 22, 2021
@webknjaz webknjaz changed the title Orphaned Files on Job Failure Break Future Jobs Orphaned Files on Job Failure Break Future Jobs on self-hosted runners Oct 15, 2022
@webknjaz webknjaz added the good first issue Good for newcomers label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants