Skip to content

fix: avoid postgres 100-argument limit in schedule, volume backup and port queries - #4931

Merged
Siumauricio merged 1 commit into
canaryfrom
fix/postgres-100-arg-limit-finders
Jul 28, 2026
Merged

fix: avoid postgres 100-argument limit in schedule, volume backup and port queries#4931
Siumauricio merged 1 commit into
canaryfrom
fix/postgres-100-arg-limit-finders

Conversation

@Siumauricio

Copy link
Copy Markdown
Contributor

Closes #4926

Migration 0175 took the application table to 101 columns, so any Drizzle relational query that hydrates the full table now exceeds Postgres' FUNC_MAX_ARGS = 100 limit in json_build_array() and fails with error 54023. This broke finPortById, findScheduleById and findVolumeBackupById — schedules and volume backups silently stopped running, and ports could not be read or edited.

Same fix as #4257 and #4924: narrow each nested application selection to the columns its consumers actually read (applicationId, appName, serverId), keeping the environment → project nesting where the org-id resolution needs it.

Also fixes two call sites not listed in the issue: both initializeJobs queries in apps/schedules/src/utils.ts hydrate application → server (102 arguments), so the cloud worker would fail to initialize schedules and volume backups on startup.

Verified against a local dev database: all five fixed queries execute correctly, while the previous shape still reproduces the 54023 failure.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jul 28, 2026
@Siumauricio
Siumauricio merged commit deebf0f into canary Jul 28, 2026
4 checks passed
@Siumauricio
Siumauricio deleted the fix/postgres-100-arg-limit-finders branch July 28, 2026 21:22
windinternet added a commit to windinternet/dokploy that referenced this pull request Jul 29, 2026
Brings in the upstream/canary HEAD (5df820a) as an ancestor of this
branch using -s ours, matching the 2026-07-15 sync policy. The merge
content is intentionally empty; this commit only records that every
cherry-picked upstream commit has been reviewed and either integrated
or explicitly rejected:

  - 32 security fixes (Dokploy#4855-Dokploy#4875): all integrated
  - 8 bug fixes (Dokploy#4626, Dokploy#4847, Dokploy#4876, Dokploy#4877, Dokploy#4911, Dokploy#4924, Dokploy#4929, Dokploy#4931): all integrated
  - 2 AI custom provider (Dokploy#4882): integrated
  - 1 icon management (Dokploy#4932): integrated with serviceNetworks stripped (Dokploy#3774 not picked)
  - SOS / Redis-removal / multi-language cleanup: rejected

After this commit, GitHub will no longer list these upstream commits
as 'ahead/behind' pending sync. Future upstream changes still need
to be re-evaluated per docs/design-docs/2026-07-29-upstream-sync-policy.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schedules, volume backups and ports are broken on canary: cannot pass more than 100 arguments to a function

1 participant