Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mounting config.xml throws Device or resource busy error #1060

Open
Truth1984 opened this issue Dec 30, 2020 · 2 comments
Open

mounting config.xml throws Device or resource busy error #1060

Truth1984 opened this issue Dec 30, 2020 · 2 comments

Comments

@Truth1984
Copy link

docker-compose:

version: "3.2"

services:
  jenkins:
    image: jenkins/jenkins:lts
    privileged: true
    volumes:
      - jenkins-data:/var/jenkins_home/
      - ./config.xml:/var/jenkins_home/config.xml #  <----------- this one
    ports:
      - 8080:8080
      - 50000:50000
    restart: always

volumes:
  jenkins-data:

config.xml:

<?xml version='1.1' encoding='UTF-8'?>
<hudson>
    <disabledAdministrativeMonitors/>
    <version>2.263.1</version>
    <installStateName>RUNNING</installStateName>
    <numExecutors>6</numExecutors>
    <mode>NORMAL</mode>
    <useSecurity>true</useSecurity>
    <authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
        <denyAnonymousReadAccess>true</denyAnonymousReadAccess>
    </authorizationStrategy>
    <securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
        <disableSignup>true</disableSignup>
        <enableCaptcha>false</enableCaptcha>
    </securityRealm>
    <disableRememberMe>false</disableRememberMe>
    <projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
    <workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}</workspaceDir>
    <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
    <jdks/>
    <viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
    <myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
    <clouds/>
    <quietPeriod>5</quietPeriod>
    <scmCheckoutRetryCount>0</scmCheckoutRetryCount>
    <views>
        <hudson.model.AllView>
            <owner class="hudson" reference="../../.."/>
            <name>all</name>
            <filterExecutors>false</filterExecutors>
            <filterQueue>false</filterQueue>
            <properties class="hudson.model.View$PropertyList"/>
        </hudson.model.AllView>
    </views>
    <primaryView>all</primaryView>
    <slaveAgentPort>50000</slaveAgentPort>
    <label></label>
    <crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer">
        <excludeClientIPFromCrumb>false</excludeClientIPFromCrumb>
    </crumbIssuer>
    <nodeProperties/>
    <globalNodeProperties/>
</hudson>j

error:

Also:   java.nio.file.FileSystemException: /var/jenkins_home/atomic1301456148988499965tmp -> /var/jenkins_home/config.xml: Device or resource busy
		at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
		at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
		at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:396)
		at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
		at java.nio.file.Files.move(Files.java:1395)
		at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:191)
java.nio.file.FileSystemException: /var/jenkins_home/config.xml: Device or resource busy
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
	at java.nio.file.Files.move(Files.java:1395)
	at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:206)
	at hudson.XmlFile.write(XmlFile.java:200)
	at jenkins.model.Jenkins.save(Jenkins.java:3381)
	at jenkins.model.Jenkins.<init>(Jenkins.java:985)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:295)
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$3.run(WebAppMain.java:312)

additional:

I ran following command before hand:
sudo chown -R 1000:1000 config.xml

@oleksandrmeleshchuk-epm

Any upd on this issue?
After updating jenkins:lts image I'm having same issue

@dduportal
Copy link
Contributor

  • Please, use the image jenkins/jenkins:lts (because jenkins:lts is deprecated since years: https://hub.docker.com/_/jenkins).
  • The error Device or resource busy is not related to Jenkins, neither to any Docker image jenkins*: it's an error message from Linux saying to the Jenkins JVM process that it's not able to write the file. It can have multiple causes thus you need to share more details with us: hat is your Host operating system, what Docker distribution are you using, how is Docker set up (output of docker info)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants