Self Checks
To make sure we get to you in time, please check the following :)
Versions
- dify-plugin-daemon Version
0.1.3-local
- dify-api Version
v1.5.1 (Docker image langgenius/dify:1.5.1)
Describe the bug
With the Google Cloud Storage backend enabled, the daemon tries to upload the same plugin asset twice within ~300 ms.
The second write carries ifGenerationMatch=0 (added by storage.Conditions{DoesNotExist:true}), so GCS returns HTTP 412 Precondition Failed.
The 412 propagates unhandled and triggers an assertion error, which terminates the process.
Cloud Run restarts the container, but the new instance hits the same assertion again → infinite restart loop; the daemon never finishes initialisation.
To Reproduce
- Deploy one replica of
dify-plugin-daemon:0.1.3-local with GCS storage.
maxInstances: 1
containerConcurrency: 1
- Cold-start the revision.
- Two
storage.objects.create calls appear in Cloud Audit Log for the same key within ~1 s; the second ends in 412 PRECONDITION_FAILED.
- The pod exits on an assertion error; Cloud Run restarts it; the loop continues indefinitely.
Expected behavior
plugin-daemon should treat “object already exists” (HTTP 412) as an idempotent success, skip the duplicate upload, and continue initialisation instead of stopping on an assertion failure.
Screenshots / Logs
Additional context
(Removing DoesNotExist:true would also work but drops the immutability guard.)
Happy to open a PR if this direction is acceptable. 🙂
::contentReference[oaicite:0]{index=0}
Self Checks
To make sure we get to you in time, please check the following :)
Versions
0.1.3-localv1.5.1(Docker imagelanggenius/dify:1.5.1)Describe the bug
With the Google Cloud Storage backend enabled, the daemon tries to upload the same plugin asset twice within ~300 ms.
The second write carries
ifGenerationMatch=0(added bystorage.Conditions{DoesNotExist:true}), so GCS returns HTTP 412 Precondition Failed.The 412 propagates unhandled and triggers an assertion error, which terminates the process.
Cloud Run restarts the container, but the new instance hits the same assertion again → infinite restart loop; the daemon never finishes initialisation.
To Reproduce
dify-plugin-daemon:0.1.3-localwith GCS storage.storage.objects.createcalls appear in Cloud Audit Log for the same key within ~1 s; the second ends in 412 PRECONDITION_FAILED.Expected behavior
plugin-daemonshould treat “object already exists” (HTTP 412) as an idempotent success, skip the duplicate upload, and continue initialisation instead of stopping on an assertion failure.Screenshots / Logs
Additional context
Failing code in
dify-cloud-kit/oss/gcsblob/gcs.go→Save():Minimal fix suggestion – intercept 412 and treat as already-exists:
(Removing
DoesNotExist:truewould also work but drops the immutability guard.)Happy to open a PR if this direction is acceptable. 🙂