Skip to content

Coder as render.com web service #6841

Closed
coder/packages
#8

Description

@matifali

Deploy Coder to render.com.

Activity

  1. changed the title [-]Coder as render.com web servive[/-] [+]Coder as render.com web service[/+] on Mar 28, 2023
  2. added
    use-caseA novel and interesting way to use Coder
    on Mar 28, 2023
  3. matifali commented on Mar 30, 2023

    @matifali
    ContributorAuthor

    Update: There seems like an issue with Render native PostgresDB; using an externally hosted database works fine. I have raised a ticket with Render support.

  4. matifali commented on Mar 30, 2023

    @matifali
    ContributorAuthor

    It looks like if we manually create a database first and then deploy the Coder service, all works fine,

    But deploying both of them together as a render blueprint fails,

    Some logs,

    First Deployment,

    connect to postgres: migrate up: up: migration failed: deadlock detected, Process 182 waits for ShareLock on virtual transaction 7/11; blocked by process 189.
    Mar 30 11:38:31 AM  Process 189 waits for ExclusiveLock on advisory lock [16389,0,943348724,1]; blocked by process 182. in line 0: CREATE INDEX CONCURRENTLY workspace_resources_job_id_idx ON workspace_resources USING btree (job_id);
    Mar 30 11:38:31 AM   (details: pq: deadlock detected)

    Onwards retries,

    connect to postgres: migrate up: up: Dirty database version 74. Fix and force version.

    Can this be a Coder issue? As deploying the Coder service manually after the database is created worked fine, @kylecarbs

  5. johnstcn commented on Mar 30, 2023

    @johnstcn
    Member

    It's possible that Render performs some kind of initial migrations on the database deployment (e.g. creating users, databases). This could be a contributing factor for the deadlocks and incomplete database migration. AFAIK we do not run our migrations in a single database transaction?

  6. matifali commented on Mar 31, 2023

    @matifali
    ContributorAuthor

    I have tested the deployment with a Fly.io starter template, and everything works fine.

    After further investigation, If I create a database manually and then deploy the blueprint, everything works fine. So I guess Render and Coder are trying to run migrations on the database when it is created as part of the render blueprint.

    PS. I am still waiting to hear back from render.com support on this.

  7. matifali commented on Apr 16, 2023

    @matifali
    ContributorAuthor

    There is an issue with render.com.
    On the first service deployment, render initiates two deployments back to back. As the first deployment is interrupted by the 2nd deployment, it leaves the database in a dirty state.

    I have raised this issue with Render support, but their email support cycles are slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

use-caseA novel and interesting way to use Coder

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions