datadog-ci icon indicating copy to clipboard operation
datadog-ci copied to clipboard

fatal: unable to rename temporary pack file: Invalid cross-device link

Open jmayday opened this issue 1 year ago • 3 comments

Bug description

I've added Bitbucket step uploading Git metadata. This is step configuration:

script:
  - curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "./datadog-ci" && chmod +x ./datadog-ci
  - export DATADOG_API_KEY=$DD_API_KEY DATADOG_SITE=datadoghq.eu
  - ./datadog-ci git-metadata upload

And this is step output

+ ./datadog-ci git-metadata upload

Uploading list of tracked files...

Reporting commit ... from repository http://.....

1160 tracked file paths will be reported.

Successfully uploaded tracked files in 0.607 seconds.

Syncing GitDB...

fatal: unable to rename temporary pack file: Invalid cross-device link

Failed generation of packfiles in tmpdir: Error: Command failed: git pack-objects --compression=9 --max-pack-size=3m /tmp/dd-packfiles-JIBJTw/4707

fatal: unable to rename temporary pack file: Invalid cross-device link

Generating them in /opt/atlassian/pipelines/agent/build instead

Successfully synced git DB in 1.046 seconds.

✅ Uploaded in 1.759 seconds.

So I don't have a clue if this succeeded or not. Neither I don't know what the error is about. Update: I see that commit has been uploaded, it's visible on https://app.datadoghq.eu/source-code/repositories

When I'm viewing stacktrace on Datadog UI, there is still that notification "Missing link to repository:

Tag your telemetry to enable the Source Code Integration and see links to your repository"

I don't know if this is because of above fatal errors from git/datadog-ci commands, or this is because of misconfiguration. PS. I've added those 2 docker labels already (to both application and datadog-agent containers as DD documentation seemed unclear for me): org.opencontainers.image.revision, org.opencontainers.image.source

Command

git-metadata

jmayday avatar Oct 16 '23 10:10 jmayday

Hello @jmayday,

Thank you for the details. The output of the command is actually misleading here: those fatal errors are "caught" and the command is generating the necessary files in another tmp folder. From the command POV, everything looks fine. I've added a card in our backlog to make the command output less confusing.

Now, it looks like despite this successful upload, you still don't have links to your repository. This can happen when your telemetry is not correctly linked. With the information available here, it is hard for me to tell what could be the cause: could you open a support ticket and provide information about the service you are trying to configure, the language, link to an error when the issue is not working properly, and the link to this GitHub issue? This would help us with the investigation.

To answer your question regarding the docker labels, they only need to be added to your application's container.

lraucy avatar Oct 16 '23 13:10 lraucy

So application's container should have docker labels (but no DD_TAGS), and datadog-agent container should have DD_TAGS env variable (but no docker labels), correct?

jmayday avatar Oct 16 '23 14:10 jmayday

So application's container should have docker labels (but no DD_TAGS), and datadog-agent container should have DD_TAGS env variable (but no docker labels), correct?

Actually the application container should have docker labels OR have DD_TAGS injected into it. The datadog-agent doesn't need any configuration for source-code-integration to work.

lraucy avatar Oct 18 '23 07:10 lraucy