cloudflare / cloudflare/developer-platform
π BUG: `504 Gateway Time-out` when applying migrations in D1
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Which Cloudflare product(s) does this pertain to?
D1
### What versions are you using?
3.102.0 [Wrangler], 20.18.0 [Node.js]
### What operating system and version are you using?
Mac Sequoia 15.2
### Please provide a link to a minimal reproduction
_No response_
### Describe the Bug
I get the following error message when I apply a migration:
```
β [ERROR] Migration 0043_cultured_the_stranger.sql failed with the following errors:
β [ERROR]
504 Gateway Time-out
504 Gateway Time-out/query -> 504 Gateway Time-out
```
The migration SQL commands:
```sql
ALTER TABLE `app_devices` DROP COLUMN `force_app_bundle_id`;
ALTER TABLE `app_devices` DROP COLUMN `force_app_channel_id`;
```
### Please provide any relevant error logs
Wrangler Logs
```
--- 2025-01-15T14:25:18.408Z debug
πͺ΅ Writing logs to "/Users/robingenz/Library/Preferences/.wrangler/logs/wrangler-2025-01-15_14-25-18_336.log"
---
--- 2025-01-15T14:25:18.408Z debug
Metrics dispatcher: Dispatching disabled - would have sent {"deviceId":"","event":"wrangler command started","timestamp":1736951118408,"properties":{"amplitude_session_id":1736951118407,"amplitude_event_id":0,"wranglerVersion":"3.102.0","osPlatform":"Mac OS","osVersion":"Darwin Kernel Version 24.2.0: Fri Dec 6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000","nodeVersion":20,"packageManager":"npm","isFirstUsage":false,"configFileType":"toml","isCI":false,"isPagesCI":false,"isWorkersCI":false,"isInteractive":true,"hasAssets":false,"argsUsed":["remote"],"argsCombination":"remote","command":"wrangler d1 migrations apply","args":{"remote":true,"xJsonConfig":true,"j":true,"preview":false,"database":""}}}.
---
--- 2025-01-15T14:25:18.410Z debug
.env file not found at ".env". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/
---
--- 2025-01-15T14:25:18.413Z debug
No experimental flag store instantiated
---
--- 2025-01-15T14:25:18.413Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated
---
--- 2025-01-15T14:25:18.413Z debug
No experimental flag store instantiated
---
--- 2025-01-15T14:25:18.413Z debug
Attempted to use flag "RESOURCES_PROVISION" which has not been instantiated
---
--- 2025-01-15T14:25:18.436Z warn
[33mβ² [43;33m[[43;30mWARNING[43;33m][0m [1mProcessing wrangler.toml configuration:[0m
- "unsafe" fields are experimental and may change or break at any time.
---
--- 2025-01-15T14:25:20.687Z log
β
οΈ wrangler 3.102.0
[38;2;255;136;0m--------------------[39m
---
--- 2025-01-15T14:25:20.688Z debug
Checking if domain has Access enabled: dash.cloudflare.com
---
--- 2025-01-15T14:25:20.688Z debug
Access switch not cached for: dash.cloudflare.com
---
--- 2025-01-15T14:25:20.796Z debug
Caching access switch for: dash.cloudflare.com
---
--- 2025-01-15T14:25:21.361Z log
π Executing on preview database ():
---
--- 2025-01-15T14:25:21.361Z log
π To execute on your local development database, remove the --remote flag from your wrangler command.
---
--- 2025-01-15T14:25:21.362Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts//d1/database//query
---
--- 2025-01-15T14:25:21.362Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:21.362Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:21.362Z debug
-- END CF API REQUEST
---
--- 2025-01-15T14:25:24.311Z debug
-- START CF API RESPONSE: OK 200
---
--- 2025-01-15T14:25:24.312Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:24.312Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:24.312Z debug
-- END CF API RESPONSE
---
--- 2025-01-15T14:25:24.312Z log
π£ Executed 1 command in 0.2813ms
---
--- 2025-01-15T14:25:24.312Z log
π Executing on preview database ():
---
--- 2025-01-15T14:25:24.312Z log
π To execute on your local development database, remove the --remote flag from your wrangler command.
---
--- 2025-01-15T14:25:24.312Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts//d1/database//query
---
--- 2025-01-15T14:25:24.312Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:24.313Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:24.313Z debug
-- END CF API REQUEST
---
--- 2025-01-15T14:25:25.985Z debug
-- START CF API RESPONSE: OK 200
---
--- 2025-01-15T14:25:25.986Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:25.986Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:25.986Z debug
-- END CF API RESPONSE
---
--- 2025-01-15T14:25:25.986Z log
π£ Executed 1 command in 0.6588ms
---
--- 2025-01-15T14:25:25.989Z log
Migrations to be applied:
---
--- 2025-01-15T14:25:25.998Z log
[90mββββββββββββββββββββββββββββββββββ[39m
[90mβ[39m[34m name [39m[90mβ[39m
[90mββββββββββββββββββββββββββββββββββ€[39m
[90mβ[39m 0043_cultured_the_stranger.sql [90mβ[39m
[90mββββββββββββββββββββββββββββββββββ[39m
---
--- 2025-01-15T14:25:35.114Z debug
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts//d1/database/
---
--- 2025-01-15T14:25:35.114Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:35.114Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:35.114Z debug
-- END CF API REQUEST
---
--- 2025-01-15T14:25:36.932Z debug
-- START CF API RESPONSE: OK 200
---
--- 2025-01-15T14:25:36.932Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:36.932Z debug
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:36.932Z debug
-- END CF API RESPONSE
---
--- 2025-01-15T14:25:36.934Z log
π Executing on preview database ():
---
--- 2025-01-15T14:25:36.934Z log
π To execute on your local development database, remove the --remote flag from your wrangler command.
---
--- 2025-01-15T14:25:36.934Z debug
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts//d1/database//query
---
--- 2025-01-15T14:25:36.934Z debug
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:36.934Z debug
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
---
--- 2025-01-15T14:25:36.934Z debug
-- END CF API REQUEST
---
```
Contributor guide
Assessment
This issue has not been assessed yet.