Skip to content

fix(compute): use http for internal jobs endpoint fallback - #13601

Merged
ArnabChatterjee20k merged 4 commits into
appwrite:mainfrom
ArnabChatterjee20k:fix/13519-jobs-endpoint-force-https
Sep 10, 2026
Merged

ArnabChatterjee20k merged 4 commits into
appwrite:mainfrom
ArnabChatterjee20k:fix/13519-jobs-endpoint-force-https

Conversation

@ArnabChatterjee20k

Copy link
Copy Markdown
Member

What

Function and site deployments stayed stuck in waiting after upgrading a self-hosted instance to 2.0. The build orchestrator built the internal artifact download and callback URLs with https:// whenever _APP_OPTIONS_FORCE_HTTPS was enabled (the default), e.g.:

failed to download file: Get https://appwrite/v1/functions/.../deployments/.../download:
dial tcp 172.22.0.22:443: connect: connection refused

Internal Docker traffic is served over plain HTTP on port 80 — TLS terminates at the public proxy, not on the internal network — so the sidecar's request hit :443 and was refused.

Fix

In src/Appwrite/Deployment/Deployments.php, the _APP_JOBS_ENDPOINT fallback no longer derives its scheme from _APP_OPTIONS_FORCE_HTTPS; it always uses http, matching the documented http://appwrite default in app/config/variables.php.

Deployments that set _APP_JOBS_ENDPOINT explicitly are unaffected.

Why upgrades were hit

Instances upgrading from 1.9.x typically don't have _APP_JOBS_ENDPOINT in their existing compose/env, so this code-level fallback is what runs.

Fixes #13519

🤖 Generated with Claude Code

https://claude.ai/code/session_01K1MtjirbwSLmUEYERnTFK2

Function/site deployments stayed stuck in "waiting" after upgrading a
self-hosted instance because the build orchestrator built the internal
artifact download + callback URLs with https:// whenever
_APP_OPTIONS_FORCE_HTTPS was enabled (the default). Internal Docker
traffic is served over plain HTTP on port 80 — TLS terminates at the
public proxy, not on the internal network — so the sidecar's download
hit :443 and got "connection refused".

Derive the _APP_JOBS_ENDPOINT fallback scheme as http regardless of the
public FORCE_HTTPS setting, matching the documented http://appwrite
default. Deployments that set _APP_JOBS_ENDPOINT explicitly are
unaffected.

Fixes appwrite#13519

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01K1MtjirbwSLmUEYERnTFK2
@greptile-apps

greptile-apps Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no outstanding findings or newly introduced issues since the previous review.

Summary

  • Explicit _APP_JOBS_ENDPOINT configuration remains unchanged.
  • Internal artifact download and callback URLs no longer default to unreachable HTTPS traffic.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix/13519-jobs-..."

Comment thread src/Appwrite/Deployment/Deployments.php Resolved
Comment thread src/Appwrite/Deployment/Deployments.php Resolved
Addressing review: the fallback must target the internal `appwrite`
service, not the public _APP_DOMAIN host. With _APP_OPTIONS_FORCE_HTTPS
enabled, an http:// URL against the public host is rejected by the
force-https middleware for the non-GET completion callback, leaving the
deployment stuck in waiting. Use the documented http://appwrite default.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01K1MtjirbwSLmUEYERnTFK2
Comment thread src/Appwrite/Deployment/Deployments.php Resolved
Per review, revert the fallback host to the platform hostname; only the
scheme was wrong. The fallback now uses http://{apiHostname} instead of
deriving the scheme from _APP_OPTIONS_FORCE_HTTPS, which produced an
https:// URL the sidecar could not reach on the internal network.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01K1MtjirbwSLmUEYERnTFK2
@ArnabChatterjee20k
ArnabChatterjee20k merged commit 3b85756 into appwrite:main Sep 10, 2026
45 checks passed
@ChiragAgg5k ChiragAgg5k mentioned this pull request Sep 10, 2026
2 of 4 tasks
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.

🐛 Bug Report: Functions stuck in "waiting" after 1.9.6 → 2.0.0 upgrade — orchestrator builds internal artifact URL with https instead of http

2 participants