question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parallel buildpack compilations fail

See original GitHub issue

What version of Cloud Foundry are you using? 1.8

What version of the buildpack you are using? 4.3.24

If you were attempting to accomplish a task, what was it you were attempting to do? Use Jenkins parallel pipeline to deploy the same app to two spaces at the same time. In our case, we were deploying to dev and qa spaces in the same org. Its possible that a feature branch and a formal dev or qa build could be happening near simulataneous which could also create this issue. Its repeatable 100% of the time if you use the parallel pipeline in jenkins.

What did you expect to happen? Expected the build to work. 😃 Not using a parallel build works fine. As soon as we enabled parallel, it broke.

What was the actual behavior? ERR OSError: [Errno 17] File exists: '/tmp/app/logs'

It looks as if the the tmp path is hardcoded to /tmp/app/logs and doesnt use a safe create directory method. IIf both builds end up staging on the same stg server, then obviously there will be a conflict and the directory for one of the builds will already exist.

Entire log output: 2016-12-28T16:48:18.51-0600 [STG/0] OUT Downloading go_buildpack_v1_7_12... 2016-12-28T16:48:18.51-0600 [STG/0] OUT Downloading java_buildpack_offline... 2016-12-28T16:48:18.51-0600 [STG/0] OUT Downloading go_buildpack... 2016-12-28T16:48:18.51-0600 [STG/0] OUT Downloading nodejs_buildpack... 2016-12-28T16:48:18.51-0600 [STG/0] OUT Downloading ruby_buildpack... 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloaded ruby_buildpack 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloaded nodejs_buildpack 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloading staticfile_buildpack... 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloaded go_buildpack 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloading php_buildpack_orig... 2016-12-28T16:48:18.52-0600 [STG/0] OUT Downloaded go_buildpack_v1_7_12 2016-12-28T16:48:18.53-0600 [STG/0] OUT Downloading python_buildpack... 2016-12-28T16:48:18.53-0600 [STG/0] OUT Downloaded java_buildpack_offline 2016-12-28T16:48:18.53-0600 [STG/0] OUT Downloading php_buildpack... 2016-12-28T16:48:18.53-0600 [STG/0] OUT Downloading binary_buildpack... 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded php_buildpack 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloading dotnet-core-buildpack... 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded php_buildpack_orig 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded staticfile_buildpack 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded binary_buildpack 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded python_buildpack 2016-12-28T16:48:18.54-0600 [STG/0] OUT Downloaded dotnet-core-buildpack 2016-12-28T16:48:18.54-0600 [STG/0] OUT Creating container 2016-12-28T16:48:18.77-0600 [STG/0] OUT Successfully created container 2016-12-28T16:48:18.77-0600 [STG/0] OUT Downloading app package... 2016-12-28T16:48:19.48-0600 [STG/0] OUT Downloaded app package (6M) 2016-12-28T16:48:19.48-0600 [STG/0] OUT Staging... 2016-12-28T16:48:20.77-0600 [STG/0] OUT -------> Buildpack version 4.3.24 2016-12-28T16:48:20.77-0600 [STG/0] ERR Traceback (most recent call last): 2016-12-28T16:48:20.77-0600 [STG/0] ERR File "/tmp/buildpacks/c924bf7a9c0f7afb68671e7d287bcbb8/scripts/compile.py", line 37, in <module> 2016-12-28T16:48:20.77-0600 [STG/0] ERR .method(setup_log_dir) 2016-12-28T16:48:20.77-0600 [STG/0] ERR File "/tmp/buildpacks/c924bf7a9c0f7afb68671e7d287bcbb8/lib/build_pack_utils/builder.py", line 512, in method 2016-12-28T16:48:20.77-0600 [STG/0] ERR execute(self.builder._ctx) 2016-12-28T16:48:20.77-0600 [STG/0] ERR File "/tmp/buildpacks/c924bf7a9c0f7afb68671e7d287bcbb8/lib/compile_helpers.py", line 71, in setup_log_dir 2016-12-28T16:48:20.77-0600 [STG/0] ERR os.makedirs(os.path.join(ctx['BUILD_DIR'], 'logs')) 2016-12-28T16:48:20.77-0600 [STG/0] ERR File "/usr/lib/python2.7/os.py", line 157, in makedirs 2016-12-28T16:48:20.77-0600 [STG/0] ERR mkdir(name, mode) 2016-12-28T16:48:20.77-0600 [STG/0] ERR OSError: [Errno 17] File exists: '/tmp/app/logs' 2016-12-28T16:48:20.77-0600 [STG/0] ERR Failed to compile droplet 2016-12-28T16:48:20.77-0600 [STG/0] OUT Exit status 223 2016-12-28T16:48:20.78-0600 [STG/0] ERR Staging failed: Exited with status 223 2016-12-28T16:48:20.79-0600 [STG/0] OUT Destroying container 2016-12-28T16:48:20.83-0600 [API/1] ERR Failed to stage application: staging failed 2016-12-28T16:48:21.16-0600 [STG/0] OUT Successfully destroyed container

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bobbyhubbardcommented, Dec 28, 2016

Work-around for posterity: do not use parallel pipeline.

0reactions
dmikusacommented, Jan 10, 2017

@bobbyhubbard - Is Jenkins using cf to do the push or the CF Java client? There are somethings in cf which are not parallel safe (i.e. if you run two instances of cf simultaneously, you could be in for a bad time). If you’re using Jenkins to drive cf, you want to make sure that you’re using the CF_HOME environment variable to point cf to a different config location. This helps with concurrency issues around the cf config / state and eliminates a lot of problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does the error "Precompiling assets failed" appear? #1168
I suddenly began to receive error when deploy. ... The first buildpack in the list below will be used. remote: ... Compilation failed:....
Read more >
cloudfoundry buildpack compilation failed - java - Stack Overflow
I made some changes and created a custom buildpack by creating a zip file(By simply compressing to zip and not using buildpack packager)....
Read more >
dpkg-dev: please consider doing parallel build (~= -Jauto) by ...
It occurs to me that if dpkg-buildpackage defaulted to a parallel build on hardware ... For memory-hungry compilations, particularly C++, ...
Read more >
Cloud Native Buildpacks: How to Create a Custom Buildpack
With code samples, this tutorial demonstrates how to create a CNB buildpack, including the configuration files, as well as detect and run ...
Read more >
How to run parallel make with debuild? - Ask Ubuntu
In order to shorten compilation time I'd like to debuild to run make in parallel (like I normally do by running make -j4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found