arcane icon indicating copy to clipboard operation
arcane copied to clipboard

๐Ÿž Bug: Scheduled prune fails due to "context deadline exceeded"

Open bjo81 opened this issue 1 month ago โ€ข 14 comments

Bug Description

Scheduled prune fails due to "context deadline exceeded". Running the scheduled prune manually succeeds.

Steps To Reproduce

Enable scheduled prune and wait until the scheduled prune runs.

Expected Behavior

Cleaned up images.

Actual Behavior

"Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.56/system/df?type=container&type=image&type=volume&type=build-cache&verbose=1": context deadline exceeded"

Screenshots

No response

Arcane Version

v2.17.1

Installation Method

Docker Compose (Recommended)

Environment Type

Local Docker (Single instance)

Database Type

PostgreSQL

Operating System

Linux

Docker Version

29.9.2, build a82e528

Browser & Version

No response

Debug Logs

arcane.log

Docker Compose Configuration


Environment Configuration (.env file)


Additional Context

No response

bjo81 avatar Oct 27 '26 11:10 bjo81

Seeing the same on a Synology NAS, with some extra detail that may help.

Environment:

  • Arcane v2.17.1 (headless agent on the affected host; manager on another host)
  • Synology DS923+, DSM 7.4.1, Docker 24.0.2, storage driver btrfs
  • Other hosts (Debian/Ubuntu/openSUSE, overlay2) are not affected

What happens:

  • The scheduled prune fails every run with: Get "...docker.sock/v1.43/system/df?type=container&type=image&type=volume&type=build-cache&verbose=1": context deadline exceeded The notification reports 0 B reclaimed, and nothing is pruned.
  • docker system df is slow on this host because of btrfs:
    • 32.6 s with ~110 images (69 of them unused);
    • 13.4 s after a manual cleanup. So the ~30 s deadline is hit whenever images have built up. Running it straight after the update job (busy disks) makes it worse.
  • After the failures, docker image prune -f by hand removed 67 dangling images (21 GB), built up over months of daily updates.

Possibly a second problem: A manually triggered prune from the UI reported success (~1 GB freed). Straight afterwards, docker images -f dangling=true still listed 12 dangling images, all from that night's updates.

Suggestions:

  • Make the disk-usage call non-fatal, or give it its own longer timeout. The prune itself doesn't depend on it.
  • Calculate the reclaimed space from the prune API responses (SpaceReclaimed) rather than from before/after system/df calls.

I've moved the scheduled prune to 3 h after the update run, and I'll report back whether timing alone avoids the error.

RadTunesly avatar Oct 29 '26 02:10 RadTunesly

@RadTunesly Thanks for taking a deeper look, I've also moved the scheduled prune run to a later point in time, but unfortunately that didn't help.

bjo81 avatar Oct 29 '26 11:10 bjo81

I had the same result. 3 h gap between update and prune gave no timeout error (I doubt this is because of the gap and likely because of the manual prune yesterday reducing the running time) and Arcane reported success with 0 B freed and 7 untagged images are present after 6 overnight updates on the affected host.

RadTunesly avatar Oct 30 '26 00:10 RadTunesly

Here it threw the error now regarding the build cache:

Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.56/system/df?type=container&type=image&type=volume&type=build-cache&verbose=1": context deadline exceeded

where nothing exists.

bjo81 avatar Oct 30 '26 07:10 bjo81

Same error here with same config as OP

ManuProd avatar Oct 30 '26 09:10 ManuProd

Updated to 2.17.3 yesterday:

01981c557d34   ghcr.io/getarcaneapp/manager:latest                              "./arcane"               13 hours ago   Up 13 hours             0.0.0.0:3552->3552/tcp, [::]:3552->3552/tcp                                                                                                                                                      arcane

unfortunately last night the issue still appeared at 6:00h:

Status	Finished with errors: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.56/system/df?type=container&type=image&type=volume&verbose=1": context deadline exceeded

bjo81 avatar Nov 05 '26 09:11 bjo81

16. Updated to 2.17.3 yesterday, unfortunately last night the issue still appeared: Status Finished with errors: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.56/system/df?type=container&type=image&type=volume&verbose=1": context deadline exceeded

Same for me, update done and the issue is still there

ManuProd avatar Nov 05 '26 09:11 ManuProd

Same on my QNAP with v2.17.3

Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.46/system/df?type=container&type=image&type=volume&verbose=1": context deadline exceeded

BlackDuck888 avatar Nov 05 '26 16:11 BlackDuck888

Seems like I got confused by 68013146b8eb90522a8d9ca75046705aa9869aaf and it's not included in 2.17.3.

bjo81 avatar Nov 06 '26 12:11 bjo81

Issue also exists with 3.0.0.

bjo81 avatar Nov 15 '26 06:11 bjo81

Issue also exists with 3.0.0.

I confirm with same version :

1 ยท Nov 15, 2026, 12:00 AM ยท Failed

Get "http://docker-socket-proxy:2375/v1.43/system/df?type=container&type=image&type=volume&verbose=1": context deadline exceeded

It works when job is done manually.

ManuProd avatar Nov 15 '26 07:11 ManuProd

E.g. https://github.com/getarcaneapp/arcane/commits/v3.0.0/backend/internal/system/children/prune contains https://github.com/getarcaneapp/arcane/commit/68013146b8eb90522a8d9ca75046705aa9869aaf, so the fix should work.

And https://myarcane.url/agents/0?tab=history&job=scheduled-prune shows just a 500.

bjo81 avatar Nov 15 '26 12:11 bjo81

Works with 3.0.1 after https://github.com/getarcaneapp/arcane/pull/4774

bjo81 avatar Nov 16 '26 11:11 bjo81

I can confirm to that is is working again with 3.0.1

BlackDuck888 avatar Nov 17 '26 07:11 BlackDuck888