#1279  Container Agent fails to run
Closed
Sean McMurray opened 1 year ago

The command to run the container assumes docker. I altered it for rootless podman.

Also, the instructions don't include the creation of the agent/work file/directory. Is it a file or a directory? I guessed it should be a directory.

$ podman run -t -v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock -v $(pwd)/agent/work:/agent/work -e serverUrl=http://myonedevserver:6610 -e agentToken=xxxxxx -h myagent 1dev/agent
--> Wrapper Started as Console
Java Service Wrapper Standard Edition 64-bit 3.5.51
  Copyright (C) 1999-2022 Tanuki Software, Ltd. All Rights Reserved.
    http://wrapper.tanukisoftware.com
  Licensed to OneDev for Service Wrapping

Launching a JVM...
WrapperManager: Initializing...
23:24:28 ERROR io.onedev.agent.Agent - Error running agent
java.lang.RuntimeException: Can not create directory '/agent/work/myagent/temp'
	at io.onedev.agent.Agent.main(Agent.java:214)
	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.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349)
	at java.base/java.lang.Thread.run(Thread.java:829)
23:24:28 INFO  io.onedev.agent.Agent - Waiting for running jobs to finish...
<-- Wrapper Stopped
Robin Shen commented 1 year ago

Please open the agent shell:

$ podman run -t -v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock -v $(pwd)/agent/work:/agent/work -e serverUrl=http://myonedevserver:6610 -e agentToken=xxxxxx -h myagent 1dev/agent bash

And run below command from the shell to see if it works:

mkdir -p /agent/work/myagent/temp
Robin Shen commented 1 year ago

Sorry use below command instead to open the shell:

$ podman run -it -v $XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock -v $(pwd)/agent/work:/agent/work -e serverUrl=http://myonedevserver:6610 -e agentToken=xxxxxx -h myagent 1dev/agent bash
Sean McMurray commented 1 year ago

It drops me into a non-responsive bash shell. I cannot type the mkdir command.

Robin Shen commented 1 year ago

Make sure to add -it option.

Robin Shen changed state to 'Closed' 1 year ago
Previous Value Current Value
Open
Closed
Robin Shen commented 1 year ago

Closing now. Feel free to reopen if there is more info.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Affected Versions
7.6.2
Issue Votes (0)
Watchers (4)
Reference
onedev/server#1279
Please wait...
Page is in error, reload to recover