buildkite / buildkite/agent

Artifact upload fails on symlink with absolute path

Open
#1,203 0 comments 0 reactions 0 assignees View on GitHub
artifacts
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

We run a test suite that creates a bunch of files. On my machine, it looks as follows:

```
$ tree tests.out.d
tests.out.d
└── cx-simtest
├── clips.log
├── debug1_2020-03-25_16-02-38.log
├── debug1_latest.log -> debug1_2020-03-25_16-02-38.log
├── debug_2020-03-25_16-02-34.log
├── debug2_2020-03-25_16-02-39.log
├── debug2_latest.log -> debug2_2020-03-25_16-02-39.log
├── debug3_2020-03-25_16-02-39.log
├── debug3_latest.log -> debug3_2020-03-25_16-02-39.log
├── debug_latest.log -> debug_2020-03-25_16-02-34.log
├── mongodb.log
├── mps
├── refbox.log
├── robot1_2020-03-25_16-02-38.log
├── robot1_latest.log -> robot1_2020-03-25_16-02-38.log
├── robot2_2020-03-25_16-02-39.log
├── robot2_latest.log -> robot2_2020-03-25_16-02-39.log
├── robot3_2020-03-25_16-02-39.log
├── robot3_latest.log -> robot3_2020-03-25_16-02-39.log
└── ros
├── a8658f22-6ea9-11ea-a37c-54e1ad10589b
│   ├── master.log
│   ├── roslaunch-leonov-94889.log
│   ├── rosout-1-stdout.log
│   └── rosout.log
├── a8659102-6ea9-11ea-857f-54e1ad10589b
│   ├── master.log
│   ├── roslaunch-leonov-94901.log
│   ├── rosout-1-stdout.log
│   └── rosout.log
├── a86599fe-6ea9-11ea-ad1f-54e1ad10589b
│   ├── master.log
│   ├── roslaunch-leonov-94904.log
│   ├── rosout-1-stdout.log
│   └── rosout.log
├── a8692fd8-6ea9-11ea-b200-54e1ad10589b
│   ├── master.log
│   ├── roslaunch-leonov-94913.log
│   ├── rosout-1-stdout.log
│   └── rosout.log
└── latest -> /home/thofmann/code/fawkes-robotino/tests.out.d/cx-simtest/ros/a8692fd8-6ea9-11ea-b200-54e1ad10589b

8 directories, 33 files
```

In particular, note that the file `tests.out.d/cx-simtest/ros/latest` is a symlink pointing to an absolute path.
Uploading the file as artifact fails:
```
$ buildkite-agent artifact upload tests.out.d/**/*
2020-03-25 15:55:51 FATAL Failed to upload artifacts: open /var/lib/buildkite-agent/builds/ammand-maskor-fh-aachen-de-1/fawkesrobotics/fawkes-robotino-build/tests.out.d/cx-simtest/ros/latest: no such file or directory
🚨 Error: exit status 1
```

This is with buildkite-agent/3.20.0.3264.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with `buildkite-agent artifact upload tests.out.d/**/*` using the `tests.out.d/cx-simtest/ros/latest` symlink and the reported agent version, 3.20.0.3264. Trace the artifact-upload entry point and verify that an artifact tree containing an absolute-path symlink uploads successfully without the reported “no such file or directory” failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.