Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't create Redis DB via API #4383

Open
SierraJC opened this issue Nov 23, 2024 · 0 comments
Open

[Bug]: Can't create Redis DB via API #4383

SierraJC opened this issue Nov 23, 2024 · 0 comments
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@SierraJC
Copy link
Contributor

Error Message and Logs

Undefined column: 7 ERROR: column "redis_password" of relation "standalone_redis" does not exist

API output: Dev / Debug enabled
{
  "message": "SQLSTATE[42703]: Undefined column: 7 ERROR:  column \"redis_password\" of relation \"standalone_redis\" does not exist\nLINE 1: ...onment_id\", \"destination_id\", \"destination_type\", \"redis_pas...\n                                                             ^ (Connection: pgsql, SQL: insert into \"standalone_redis\" (\"name\", \"environment_id\", \"destination_id\", \"destination_type\", \"redis_password\", \"description\", \"image\", \"is_public\", \"public_port\", \"limits_memory\", \"limits_memory_swap\", \"limits_memory_swappiness\", \"limits_memory_reservation\", \"limits_cpus\", \"limits_cpuset\", \"limits_cpu_shares\", \"uuid\", \"updated_at\", \"created_at\") values (api db, 1, 0, App\\Models\\StandaloneDocker, password, ?, redis:7.2, 0, ?, 0, 0, 60, 0, 0, ?, 1024, pgws44wgsggwowk0kwosws4k, 2024-11-23 23:15:24, 2024-11-23 23:15:24) returning \"id\")",
  "exception": "Illuminate\\Database\\QueryException",
  "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
  "line": 825,
  "trace": [
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
      "line": 779,
      "function": "runQueryCallback",
      "class": "Illuminate\\Database\\Connection",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
      "line": 398,
      "function": "run",
      "class": "Illuminate\\Database\\Connection",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php",
      "line": 385,
      "function": "select",
      "class": "Illuminate\\Database\\Connection",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Processors/PostgresProcessor.php",
      "line": 24,
      "function": "selectFromWriteConnection",
      "class": "Illuminate\\Database\\Connection",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php",
      "line": 3798,
      "function": "processInsertGetId",
      "class": "Illuminate\\Database\\Query\\Processors\\PostgresProcessor",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php",
      "line": 2038,
      "function": "insertGetId",
      "class": "Illuminate\\Database\\Query\\Builder",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
      "line": 1358,
      "function": "__call",
      "class": "Illuminate\\Database\\Eloquent\\Builder",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
      "line": 1323,
      "function": "insertAndSetId",
      "class": "Illuminate\\Database\\Eloquent\\Model",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php",
      "line": 1162,
      "function": "performInsert",
      "class": "Illuminate\\Database\\Eloquent\\Model",
      "type": "->"
    },
    {
      "file": "/var/www/html/bootstrap/helpers/databases.php",
      "line": 59,
      "function": "save",
      "class": "Illuminate\\Database\\Eloquent\\Model",
      "type": "->"
    },
    {
      "file": "/var/www/html/app/Http/Controllers/Api/DatabasesController.php",
      "line": 1321,
      "function": "create_standalone_redis"
    },
    {
      "file": "/var/www/html/app/Http/Controllers/Api/DatabasesController.php",
      "line": 758,
      "function": "create_database",
      "class": "App\\Http\\Controllers\\Api\\DatabasesController",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
      "line": 54,
      "function": "create_database_redis",
      "class": "App\\Http\\Controllers\\Api\\DatabasesController",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
      "line": 43,
      "function": "callAction",
      "class": "Illuminate\\Routing\\Controller",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
      "line": 264,
      "function": "dispatch",
      "class": "Illuminate\\Routing\\ControllerDispatcher",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
      "line": 210,
      "function": "runController",
      "class": "Illuminate\\Routing\\Route",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
      "line": 808,
      "function": "run",
      "class": "Illuminate\\Routing\\Route",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 144,
      "function": "Illuminate\\Routing\\{closure}",
      "class": "Illuminate\\Routing\\Router",
      "type": "->"
    },
    {
      "file": "/var/www/html/app/Http/Middleware/IgnoreReadOnlyApiToken.php",
      "line": 20,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "App\\Http\\Middleware\\IgnoreReadOnlyApiToken",
      "type": "->"
    },
    {
      "file": "/var/www/html/app/Http/Middleware/ApiAllowed.php",
      "line": 30,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "App\\Http\\Middleware\\ApiAllowed",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
      "line": 51,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
      "line": 161,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
      "line": 127,
      "function": "handleRequest",
      "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
      "line": 89,
      "function": "handleRequestUsingNamedLimiter",
      "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
      "line": 64,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Auth\\Middleware\\Authenticate",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 119,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
      "line": 807,
      "function": "then",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
      "line": 786,
      "function": "runRouteWithinStack",
      "class": "Illuminate\\Routing\\Router",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
      "line": 750,
      "function": "runRoute",
      "class": "Illuminate\\Routing\\Router",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
      "line": 739,
      "function": "dispatchToRoute",
      "class": "Illuminate\\Routing\\Router",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
      "line": 201,
      "function": "dispatch",
      "class": "Illuminate\\Routing\\Router",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 144,
      "function": "Illuminate\\Foundation\\Http\\{closure}",
      "class": "Illuminate\\Foundation\\Http\\Kernel",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php",
      "line": 19,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php",
      "line": 59,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
      "line": 21,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
      "line": 31,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
      "line": 21,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
      "line": 51,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php",
      "line": 27,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Http\\Middleware\\ValidatePostSize",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
      "line": 110,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php",
      "line": 62,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Http\\Middleware\\HandleCors",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php",
      "line": 58,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 183,
      "function": "handle",
      "class": "Illuminate\\Http\\Middleware\\TrustProxies",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
      "line": 119,
      "function": "Illuminate\\Pipeline\\{closure}",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
      "line": 176,
      "function": "then",
      "class": "Illuminate\\Pipeline\\Pipeline",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
      "line": 145,
      "function": "sendRequestThroughRouter",
      "class": "Illuminate\\Foundation\\Http\\Kernel",
      "type": "->"
    },
    {
      "file": "/var/www/html/public/index.php",
      "line": 51,
      "function": "handle",
      "class": "Illuminate\\Foundation\\Http\\Kernel",
      "type": "->"
    }
  ]
}
API output: Production
{
  "message": "Server Error"
}

Steps to Reproduce

  1. Send POST request to /databases/redis with redis_password field filled

    cURL
    curl --request POST \
      --url http://localhost:8000/api/v1/databases/redis \
      --header 'authorization: Bearer {{token}}' \
      --header 'content-type: application/json' \
      --data '{
      "server_uuid": "{{serverUUID}}",
      "project_uuid": "{{projectUUID}}",
      "environment_name": "{{environmentName}}",
      "redis_password": "my_password",
      "name": "api db",
      "description": "",
      "image": "redis:7.2",
      "is_public": false,
      "public_port": null,
      "limits_memory": "0",
      "limits_memory_swap": "0",
      "limits_memory_swappiness": "60",
      "limits_memory_reservation": "0",
      "limits_cpus": "0",
      "limits_cpuset": null,
      "limits_cpu_shares": "1024",
      "instant_deploy": false
    }'
  2. See error.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.372

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04

Additional Information

The database will be created if the redis_password field is entirely omitted, but this is not ideal as I want to manage & rotate the password myself via API.

Additionally, the GET /databases/:uuid API on a Redis DB does not return the current redis_password.

@SierraJC SierraJC added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

1 participant