C
Coder.com10mo ago
Danish

Create workspace API endpoint stops working after upgrading Coder

I upgraded my Coder deployment from version 2.0.2 to 2.8.1 (yes i know huge jump). The create workspace endpoint used to worked fine through my application / manually through curl or postman. After upgrading, I'm getting the following error message
{
"message": "Validation failed.",
"validations": [
{
"field": "template_id",
"detail": "Validation failed for tag \"excluded_with\" with value: \"d2d78fd3-13bf-4b89-8bb0-f24896da945b\""
},
{
"field": "template_version_id",
"detail": "Validation failed for tag \"excluded_with\" with value: \"59feb82d-72e0-414e-aa62-570c4ba65539\""
}
]
}
{
"message": "Validation failed.",
"validations": [
{
"field": "template_id",
"detail": "Validation failed for tag \"excluded_with\" with value: \"d2d78fd3-13bf-4b89-8bb0-f24896da945b\""
},
{
"field": "template_version_id",
"detail": "Validation failed for tag \"excluded_with\" with value: \"59feb82d-72e0-414e-aa62-570c4ba65539\""
}
]
}
No description
5 Replies
Codercord
Codercord10mo ago
<#1204991551843991602>
Category
Bug report
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Danish
DanishOP10mo ago
Coder v2.0.2+76ad116 - Your Self-Hosted Remote Development Platform
Started HTTP listener at http://0.0.0.0:3000
Using built-in PostgreSQL (/home/<user>/.config/coderv2/postgres)

View the Web UI: <my_coder_deployment>
Stopping built-in PostgreSQL...
Stopped built-in PostgreSQL
running command "coder server": connect to postgres:
github.com/coder/coder/cli.(*RootCmd).Server.func1
/home/runner/actions-runner/_work/coder/coder/cli/server.go:619
- migrate up:
github.com/coder/coder/cli.connectToPostgres
/home/runner/actions-runner/_work/coder/coder/cli/server.go:1949
- up:
github.com/coder/coder/coderd/database/migrations.Up
/home/runner/actions-runner/_work/coder/coder/coderd/database/migrations/migrate.go:81
- no migration found for version 187: read down for version 187 .: file does not exist
Coder v2.0.2+76ad116 - Your Self-Hosted Remote Development Platform
Started HTTP listener at http://0.0.0.0:3000
Using built-in PostgreSQL (/home/<user>/.config/coderv2/postgres)

View the Web UI: <my_coder_deployment>
Stopping built-in PostgreSQL...
Stopped built-in PostgreSQL
running command "coder server": connect to postgres:
github.com/coder/coder/cli.(*RootCmd).Server.func1
/home/runner/actions-runner/_work/coder/coder/cli/server.go:619
- migrate up:
github.com/coder/coder/cli.connectToPostgres
/home/runner/actions-runner/_work/coder/coder/cli/server.go:1949
- up:
github.com/coder/coder/coderd/database/migrations.Up
/home/runner/actions-runner/_work/coder/coder/coderd/database/migrations/migrate.go:81
- no migration found for version 187: read down for version 187 .: file does not exist
If I downgrade back, I get the above error so I'm kinda stuck here. Looking at a similar issue reported here, I guess fix to the above migration issue is to delete the postgres database? (to be fair I didn't backup a snapshot of database as the docs suggested) Would like some guidance on how that's done Edit: Nvm, I think I found how to delete the database by going over the uninstall Coder docs. Got the fix by going through the release notes of each version after 2.0.2. Turns out the param template_version_id has been replaced with template_active_version_id and that's what causing the issue in the API request
Danish
DanishOP10mo ago
GitHub
Change template_version_id -> template_active_version_id in API...
Following up from the discord thread I noticed the API docs for create workspace haven't been updated to mention this change. template_version_id no longer works for creating a workspace throug...
Phorcys
Phorcys7mo ago
Issue was figured out in GH:
I see it still as template_version_id: https://github.com/coder/coder/blob/main/codersdk/organizations.go#L145-L145 The issue ran into in discord is you cannot provide both template_id and template_version_id. They are mutually exclusive. I will update the docs
Codercord
Codercord7mo ago
@Phorcys closed and locked the thread.
Want results from more Discord servers?
Add your server