3

I setup a local drone server for our CI. And our project is a java project managed by maven. When run the mvn clean install command, maven will download all dependencies into ~/.m2 directory. The first time run this command will download a huge of data from maven remote repository which may take a very long time. In this case, I got below error on drone CI.

ERROR: terminal inactive for 15m0s, build cancelled

I understand that this message means there is no output on the console for 15 minutes. But it is a normal case in my build environment. I wander whether I can configure the 15m to be a larger value so I can build our project.

2 Answers 2

4

My previous answer is outdated. You can now change the default timeout for each individual repository from the repository settings screen. This setting is only available to system administrators.


You can increase the terminal inactive timeout by passing DRONE_TIMEOUT=<duration> to each of your agents.

docker run -e DRONE_TIMEOUT=15m drone/drone:0.5 agent

The timeout value may be any valid Go duration string [1].

# 30 minute timeout
DRONE_TIMEOUT=30m

# 1 hour timeout
DRONE_TIMEOUT=1h

# 1 hour, 30 minute timeout
DRONE_TIMEOUT=1h30m

[1] https://golang.org/pkg/time/#ParseDuration

7
  • Is there a way to configure this via the .drone.yml? In other words, at the project level?
    – Senkwich
    Dec 28, 2016 at 19:39
  • same question, whether we can set it in yml? Dec 28, 2016 at 23:48
  • No, this timeout is global. Dec 29, 2016 at 13:58
  • I should mention that drone has two different timeouts. There is a per-repository timeout that defaults to 60 minutes, and can be modified in the UI. The timeout mentioned above, however, is a global configuration that kills the build if it doesn't write to the terminal for > 15 minutes. This prevents people from accidentally hanging the build with blocking commands. Dec 29, 2016 at 13:59
  • The per-repository timeout isn't for inactivity, right? So, the only way to change the inactivity timeout is with the global setting? I'm the maintainer of github.com/ensime/scala-debugger, which is part of the ensime family. We upgraded drone recently and now I'm hitting the inactivity issue while compiling a lot of code on our slowest machine in our cluster. I wish there was some way for a maintainer of a project (or an admin of drone) to be able to configure the inactivity timeout per project.
    – Senkwich
    Dec 29, 2016 at 14:56
0

Looking at the drone source code, it looks like they have environment variables DRONE_TIMEOUT and DRONE_TIMEOUT_INACTIVITY that you can use to configure the inactivity timeout. I tried putting it in my .drone.yml file and it didn't seem to do anything, so this may only be available at a higher level.

Here is the reference to the environment variable DRONE_TIMEOUT_INACTIVITY: https://github.com/drone/drone/blob/17e5eb50363f3fcdc0a0461162bee93041d600b7/drone/exec.go#L62

Here is the reference to the environment variable DRONE_TIMEOUT: https://github.com/drone/drone/blob/eee4fd1fd2556ac9e4115c746ce785c7364a6f12/drone/agent/agent.go#L95

Here is where the error is thrown: https://github.com/drone/drone/blob/5abb5de44aa11ea546db1d3846d603eacef7f0d9/agent/agent.go#L206

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.