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

New agents erroneously running as root #3132

Closed
basil opened this issue Sep 16, 2022 · 6 comments
Closed

New agents erroneously running as root #3132

basil opened this issue Sep 16, 2022 · 6 comments
Assignees
Labels
bug Something isn't working ci.jenkins.io

Comments

@basil
Copy link
Collaborator

basil commented Sep 16, 2022

Service(s)

ci.jenkins.io

Summary

The new JNLP agent images appear to have the agent Remoting process running as root. Among other things, this breaks core's ArtifactArchiverTest with

[ERROR] Tests run: 16, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 49.046 s <<< FAILURE! - in hudson.tasks.ArtifactArchiverTest
[ERROR] hudson.tasks.ArtifactArchiverTest.archiveNotReadable  Time elapsed: 3.343 s  <<< FAILURE!
java.lang.AssertionError: 
unexpected build status; build log was:
------
Started
Running as SYSTEM
Building remotely on slave0 (target) in workspace /home/jenkins/workspace/Core_jenkins_PR-7110/test/target/j h598731013486653119/agent-work-dirs/slave0/workspace/test0
Archiving artifacts
Finished: SUCCESS

------

Expected: is <FAILURE>
     but: was <SUCCESS>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1473)
	at org.jvnet.hudson.test.JenkinsRule.assertBuildStatus(JenkinsRule.java:1479)
	at org.jvnet.hudson.test.JenkinsRule.buildAndAssertStatus(JenkinsRule.java:1526)
	at hudson.tasks.ArtifactArchiverTest.archiveNotReadable(ArtifactArchiverTest.java:403)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:613)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:829)

because the test is expecting to run as a regular user. Probably many plugin tests are broken with this change as well.

Please restore the old behavior of running as a regular user.

Reproduction steps

Go to e.g. https://ci.jenkins.io/computer/jnlp%2Dmaven%2D11%2Dqh9kg/script and run System.getProperty("user.name").

@basil basil added the triage Incoming issues that need review label Sep 16, 2022
@dduportal dduportal added this to the infra-team-sync-2022-09-20 milestone Sep 16, 2022
@dduportal dduportal added bug Something isn't working and removed triage Incoming issues that need review labels Sep 16, 2022
@dduportal
Copy link
Contributor

@dduportal
Copy link
Contributor

dduportal commented Sep 16, 2022

Please note that the user jenkins has an UID of 1001 like the VM agents, while the former containers were using an unfixed UID: https://github.com/jenkins-infra/docker-inbound-agents/blob/main/maven/jdk11/Dockerfile .

That might not be a strong change but better to make it explicit.

@dduportal
Copy link
Contributor

jenkins-infra/packer-images#342 should fix the issue

@dduportal
Copy link
Contributor

@dduportal
Copy link
Contributor

Closing as the archiving artifacts step seems to work.

Thanks @basil for raising this issue!

@basil
Copy link
Collaborator Author

basil commented Sep 16, 2022

Thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci.jenkins.io
Projects
None yet
Development

No branches or pull requests

3 participants