Details
-
Bug
-
Resolution: Done
-
High
-
5.12.4, 5.13.0.1
-
Severity 2 - Major
-
Description
Summary
In Bamboo 5.13 defining an artifact definition with a location of '/' will cause the artifact copy to traverse root – consuming a lot of system resources and causing Bamboo to hang or build to fail with OOM.
It was possible to define a location of '/' in Bamboo 5.12.3 however the behavior was different, it would still work relatively.
If this was intended from BAM-16970, possibly the upgrade needs to convert the src_directory for the artifact definition to relative as not to cause issues upon upgrade from 5.12.x.
The UI still reports that the Location path is relative.
Steps to Reproduce
- Create a build plan on 5.12
- Define shared artifact with:
Location: / Copy pattern: **/*
- Run build > Works successfully and shares only the build-dir as artifacts
- Upgrade same DB to 5.13
- Run same build > We get messages about skipping symbolic links from root (depending on FS) > System resource usage escalates > Can eventually OOM depending on setup
Expected Results
Depending on intended behavior either:
- Upgrade task should convert Location with starting '/' to a relative path or
- Search should be relative and absolute paths disallowed
Actual Results
Same artifact definition from 5.12 causes issues in 5.13.
Build messages stop here:
2016-09-05 22:01:55,607 INFO [17-BAM::Agent::Agent:pool-33-thread-1] [BuildArtifactPostProcessor] Copying the build artifacts for build: TEST-PLAN-JOB-1
We then see lots of messages of skipping symbolic links at the root of the filesystem. E.g.:
skipping symbolic link /lib/recovery-mode/recovery-mode/recovery-mode/recovery-mode/recovery-mode/recovery-mode -- too many levels of symbolic links. skipping symbolic link /proc/self/task/2749/root/lib/recovery-mode/recovery-mode/recovery-mode/recovery-mode/recovery-mode/recovery-mode -- too many levels of symbolic links.
Notes
Check extent of affected definitions with:
SELECT b.FULL_KEY, a.SRC_DIRECTORY, a.COPY_PATTERN
FROM ARTIFACT_DEFINITION a
INNER JOIN BUILD b
ON a.PRODUCER_JOB_ID=b.BUILD_ID
WHERE a.SRC_DIRECTORY LIKE '/%';
This will return any that start at root, however the problematic ones are likely just to be only the ones with '/' as if they were previously defined as relative paths, the rest of the path very likely won't exist at root.
Workaround
- Remove starting "/" from Location for artifact definition at Plan Configuration >> Job >> Artifacts
- or DB query that will modify ARTIFACT_DEFINITION.SRC_DIRECTORY