osrf / docker_images

A repository to hold definitions of docker images maintained by OSRF
Apache License 2.0
577 stars 172 forks source link

fix git safe directory for library generation #704

Closed mikaelarguedas closed 11 months ago

mikaelarguedas commented 11 months ago

Without this the createlibrary script fails with

Traceback (most recent call last):
  File "/tmp/docker_images/ros/./create_dockerlibrary.py", line 50, in <module>
    main()
  File "/tmp/docker_images/ros/./create_dockerlibrary.py", line 37, in main
    manifest = parse_manifest(manifest, repo, repo_name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/docker_templates/library.py", line 53, in parse_manifest
    commit_sha = latest_commit_sha(repo, commit_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/docker_templates/library.py", line 22, in latest_commit_sha
    log_message = repo.git.log("-1", path)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 736, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1316, in _call_process
    return self.execute(call, **exec_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/git/cmd.py", line 1111, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git log -1 ros/noetic/ubuntu/focal/ros-core
  stderr: 'fatal: detected dubious ownership in repository at '/tmp/docker_images'
To add an exception for this directory, call:

    git config --global --add safe.directory /tmp/docker_images'
mikaelarguedas commented 11 months ago

:shrug:

We didnt have failed ci for many months (too old to check logs) and as automated PR generation hasn't worked for 2.5years we may not notice if this cause an issue.