Skip to content

Conversation

@93Pd9s8Jt
Copy link

@93Pd9s8Jt 93Pd9s8Jt commented Mar 25, 2025

Increase rclone startup timeout from 15 seconds to 15 minutes
Should fix #2573

increase rclone startup timeout from 15 seconds to 15 minutes
@93Pd9s8Jt 93Pd9s8Jt changed the title Increase reclone startup timeout Increase rclone startup timeout Mar 25, 2025
Copy link
Collaborator

@julio-lopez julio-lopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the const / fixed default value, make the value configurable, persist it in the configuration and use the same default value as before.

@93Pd9s8Jt
Copy link
Author

Instead of changing the fixed value, make the value configurable, persist it in the configuration and use the same default value as before.

To my understanding, it is already configurable:
https://github.com/kopia/kopia/blob/master/repo/blob/rclone/rclone_storage.go#L348-L351

However, this is useless on the UI builds, for which you can't modify the configuration (at least, I couldn't see how to).
In addition, a timeout should be a lower bound, and rclone configurations can easily exceed 15 seconds. It should not block me from using the app.

@93Pd9s8Jt
Copy link
Author

@julio-lopez , please could you have another look at this?

@julio-lopez
Copy link
Collaborator

The rclone storage provider has a StartupTimeout option that is not exposed through the CLI. The right approach is to expose this option through the CLI. Once it is exposed through the CLI, then it could be exposed through the UI as well. Modifying the default value is not desirable.

@93Pd9s8Jt
Copy link
Author

93Pd9s8Jt commented Apr 13, 2025

@julio-lopez I would say modifying the default value is desirable, because it clearly blocks me and others from using kopia. If it is higher, I do not see any downsides major enough to warrant blocking people from using the app.
Whilst I agree it would be desirable to expose the option, my knowledge of go (i.e. none) isn't good enough to implement that. So this is therefore necessary as an intermeditary stopgap solution. If you disagree, please close this pull request.

@93Pd9s8Jt 93Pd9s8Jt closed this Apr 13, 2025
@93Pd9s8Jt 93Pd9s8Jt reopened this Apr 13, 2025

// rcloneStartupTimeout is the time we wait for rclone to print the https address it's serving at.
rcloneStartupTimeout = 15 * time.Second
rcloneStartupTimeout = 15 * time.Minute
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default of 15 minutes is way too high, I would be ok with 1 minute

+1 to what Julio says about making it configurable. Configuration options like this are actually quite easy to expose in the CLI and UI.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkowalski
My current rclone config takes 3 minutes and 10 seconds to start up. (I realise this may not be normal, but nevertheless.) So I wouldn't mind 5 minutes, but 1 minute wouldn't help me (though might resolve others' problems).

I believe you when you say it would be easy, but I'm not confident enough in my own programming knowledge to attempt this with no knowledge of go.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a field in UI configuration is easily copy-pasteable:

You need to change:

https://github.com/kopia/htmlui/blob/main/src/components/SetupRepositoryRclone.jsx

Adding OptionalNumberField for a field named startupTimeout should do the trick.

https://github.com/kopia/htmlui/blob/1e35b648ac5a9444dce2d07fdbede9abb78daf83/src/components/SetupRepositorySFTP.jsx#L62C17-L62C103 is an example.

Instructions for testing UI changes are in the readme file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that does look easy enough to implement, but I can't get it to build on my system.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to install npm from NodeJS and then npm install in htmlui directory followed by npm run build should do the trick.

npm run serve should launch the UI for testing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the readme says to run go run . server start --insecure --without-password --disable-csrf-token-checks --log-level=debug --config-file=$HOME/.config/kopia/disabled/repository-dev.config to start the server (running in kopia directory), which works and serves a webpage on port 51515.
Then I ran npm etc. and it served on port 3000 and failed to load.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like running the server builds with the html from htmlui?

@93Pd9s8Jt
Copy link
Author

Am I correct in understanding (given #4543 was merged) that the change needs to be made to htmlui rather than this repository, and so this pull request can be closed?

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

Successfully merging this pull request may close these issues.

unable to start rclone: timed out waiting for rclone to start

3 participants