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

doc action failing #1779

Closed
kosack opened this issue Aug 25, 2021 · 10 comments · Fixed by #1780
Closed

doc action failing #1779

kosack opened this issue Aug 25, 2021 · 10 comments · Fixed by #1780

Comments

@kosack
Copy link
Contributor

kosack commented Aug 25, 2021

Since a few weeks ago at least, the docs action in the CI is failing for all new PRs and the master, e.g.:
https://github.com/cta-observatory/ctapipe/actions/runs/1159019166

Seems to be some change in the sphinx-action perhaps.

@kosack
Copy link
Contributor Author

kosack commented Aug 25, 2021

For reference, the failure is as follows (Seems to be problems in the pre-build step, and later commands like "git" are not found):

/usr/bin/docker run --name c9e036e0f331c7ba2140808c4ac386e5637e95_3e061a --label c9e036 --workdir /github/workspace --rm -e NUMBA_NUM_THREADS -e MPLBACKEND -e PYTEST_ADDOPTS -e INPUT_DOCS-FOLDER -e INPUT_PRE-BUILD-COMMAND -e INPUT_BUILD-COMMAND -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ctapipe/ctapipe":"/github/workspace" c9e036:e0f331c7ba2140808c4ac386e5637e95

Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
  Downloading pip-21.2.4-py3-none-any.whl (1.6 MB)
Collecting setuptools
  Downloading setuptools-57.4.0-py3-none-any.whl (819 kB)
Collecting wheel
  Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
  Attempting uninstall: setuptools
    Found existing installation: setuptools 45.2.0
    Uninstalling setuptools-45.2.0:
      Successfully uninstalled setuptools-45.2.0
  Attempting uninstall: wheel
    Found existing installation: wheel 0.34.2
    Uninstalling wheel-0.34.2:
      Successfully uninstalled wheel-0.34.2
Successfully installed pip-21.2.4 setuptools-57.4.0 wheel-0.37.0
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Obtaining file:///github/workspace
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
    Preparing wheel metadata: started
    ERROR: Command errored out with exit status 1:
    Preparing wheel metadata: finished with status 'error'
     command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpb4rjoofo
         cwd: /github/workspace
    Complete output (40 lines):
    Traceback (most recent call last):
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
        main()
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 40, in <module>
        setup(
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 455, in __init__
        _Distribution.__init__(self, {
      File "/usr/local/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 807, in finalize_options
        ep(self)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 814, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 24, in version_keyword
        dist.metadata.version = _get_version(config)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 173, in _get_version
        parsed_version = _do_parse(config)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 127, in _do_parse
        version = _version_from_entrypoints(config) or _version_from_entrypoints(
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 65, in _version_from_entrypoints
        version = _call_entrypoint_fn(root, config, ep.load())
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 46, in _call_entrypoint_fn
        return fn(root, config=config)
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/git.py", line 115, in parse
        require_command("git")
      File "/tmp/pip-build-env-0u63b3km/overlay/lib/python3.8/site-packages/setuptools_scm/utils.py", line 142, in require_command
        raise OSError("%r was not found" % name)
    OSError: 'git' was not found
    ----------------------------------------
WARNING: Discarding file:///github/workspace. Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpb4rjoofo Check the logs for full command output.
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpb4rjoofo Check the logs for full command output.
sh: 4: git: not found
/github/workspace/ctapipe/version.py:12: UserWarning: Could not determine ctapipe version; this indicates a broken installation. Install ctapipe from PyPI, using conda or from a local git repository. Installing github's autogenerated source release tarballs  does not include version information and should be avoided.
0.0.0
  warnings.warn(
Running Sphinx v2.4.4

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/sphinx/config.py", line 348, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/local/lib/python3.8/site-packages/sphinx/util/pycompat.py", line 81, in execfile_
    exec(code, _globals)
  File "/github/workspace/docs/conf.py", line 32, in <module>
    import ctapipe
ModuleNotFoundError: No module named 'ctapipe'

make: *** [Makefile:20: html] Error 2
[sphinx-action] Starting sphinx-action build.
Running: apt update --yes && apt install --yes git build-essential pandoc
pip install -U pip setuptools wheel
pip install -e .[docs]
git describe --tags
python -c 'import ctapipe; print(ctapipe.__version__)'

====================================
Building docs in docs/
====================================
[sphinx-action] Running: ['make', 'html', 'SPHINXOPTS=-W --keep-going -n --color -w /tmp/sphinx-log', '-e']
[sphinx-action] Build failed with 0 warnings
Traceback (most recent call last):
  File "/entrypoint.py", line 22, in <module>
    action.build_all_docs(github_env, [os.environ.get("INPUT_DOCS-FOLDER")])
  File "/sphinx_action/action.py", line 167, in build_all_docs
    raise RuntimeError("Build failed")
RuntimeError: Build failed

@HealthyPear
Copy link
Member

also for reference: downgrading the action to the latest tagged release doesn't help - perhaps we should consider opening an issue there?

@kosack
Copy link
Contributor Author

kosack commented Aug 25, 2021

I think the issue is our pre-build step, not the action itself. The problem may be unrelated to the sphinx action, but to the docker container or something (update to ubuntu, etc).

@maxnoe
Copy link
Member

maxnoe commented Aug 25, 2021

Seems the problem is a missing git. Maybe it got removed from the default debian docker image. We should be able to just apt install -y git in the pre-build-command

@maxnoe
Copy link
Member

maxnoe commented Aug 25, 2021

Ok, we already do have that in the pre-build command

@maxnoe
Copy link
Member

maxnoe commented Aug 25, 2021

Seems the problem is the apt update step:

 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Reading package lists...
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldstable-updates'
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'

looks like an error due to the new debian release.

@maxnoe
Copy link
Member

maxnoe commented Aug 25, 2021

I opened an issue with the action: ammaraskar/sphinx-action#33

@HealthyPear
Copy link
Member

I think we should start thinking to find an alternative in case we receive no fast response: from that repo, I see that the last answer by the maintainer(s) is around April of this year

@kosack
Copy link
Contributor Author

kosack commented Aug 30, 2021

There is also the warning:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts

Not sure what the alternative would be for installing things though! (and apt has been around for quite a while, so not sure why it would still be considered unstable... maybe they prefer apt-get directly, rather than the apt wrapper?)

@maxnoe
Copy link
Member

maxnoe commented Aug 30, 2021

@kosack that warning is there since always and forever (and yes, I think it's the distinction between apt and apt-get).

The real issue here is the release of a new debian version, that somehow makes the update step fail and then the install fails because no package lists are available.

@maxnoe maxnoe linked a pull request Aug 30, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants