Thanks to visit codestin.com
Credit goes to github.com

Skip to content

workspace name too long for coder_app #8145

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

Closed
Tracked by #10919
fschaell opened this issue Jun 22, 2023 · 6 comments · Fixed by #9645
Closed
Tracked by #10919

workspace name too long for coder_app #8145

fschaell opened this issue Jun 22, 2023 · 6 comments · Fixed by #9645
Assignees
Labels
s2 Broken use cases or features (with a workaround). Only humans may set this. stale This issue is like stale bread.

Comments

@fschaell
Copy link

Hi,

I used coder and want to creating different workspaces. The length of workspace name can be 32 characters. If you set the name to 32 characters, then error 404 occur by clicking coder-server button.

You can solve the issue by setting workspace name to 31 characters.

It seems it is a bug by handling workspace name to open coder-server instance.

Regards,
Frank
image

image
@cdr-bot cdr-bot bot added the bug label Jun 22, 2023
@sharkymark
Copy link
Contributor

There is a size limit to the first segment (left of domain name) of the IDE URL. 61 or 63 characters.

So check the length of the agent name, coder_app name, workspace name, user name - which make up that segment, to see if they exceed that.

@ammario ammario added the s2 Broken use cases or features (with a workaround). Only humans may set this. label Jun 22, 2023
@ammario
Copy link
Member

ammario commented Jun 22, 2023

When the segment exceeds 63 characters, we could suggest an alternate URL that uses a constant-length format. For example, the agent ID.

@matifali matifali self-assigned this Aug 31, 2023
@matifali matifali changed the title workspace name too long for open code-server workspace name too long for coder_app Aug 31, 2023
@matifali matifali removed their assignment Aug 31, 2023
@mtojek mtojek self-assigned this Sep 8, 2023
@mtojek
Copy link
Member

mtojek commented Sep 8, 2023

I'm looking into this now.

@mtojek
Copy link
Member

mtojek commented Oct 10, 2023

I incorrectly assumed that the workspace apps proxy server uses the database to match subdomains (URLs are stored in the database). @deansheater brought up that issue (thanks!) and suggested
reverting CRC32 part of the solution.

In the meantime, we identified other issues:

  1. The subdomain part should be 62 chars long or 63 chars with the trailing dot.
  2. Shortener does not work with wildcards configured like *-foobar.tunnel.tld, as the --foobar part is not considered in the shortening process.

If I understand the issue correctly, to make it work we need to:

  1. Consider the edge case with subdomains with tunnel suffixes, e.g. *-foobar.
  2. Keep shortened URLs in the token issued by the proxy server.
  3. Store shortened app URLs in the database.
  4. Add logic to match the shortened URL with the particular application.

also from @deansheater slack:

I want to make some optimizations regarding the hostnames anyways, for example we can drop the agent name if you're using an app slug since app slugs are unique per template
which should save a lot of characters for most people

@mafredri
Copy link
Member

Bumping as I ended up with the following subdomain:

https://http-echo--main--scaletest-UN9UmkDA-0--scaletest-SMXCCYVP-0--apps.big.cdr.dev

Would it make sense for this to break during terraform plan/apply already?

I think @mtojek's proposal sounds good considering we obviously can take multiple precautions for ensuring less noise in the subdomain, but we still have usernames and workspace names that are capped at 32, so we should assume those alone can use up all the available space. Not to mention the possibility of using subdomain suffixes.

I think it's important we consider that the URL should work across template versions and updated workspaces. I think the best option is for us to generate a new UUID for use in the URL based on workspace ID and app slug, this gives us a constant 32 (or 36 with dashes) length subdomain, and leaves room for nearly as many more.

The reason I'd avoid using e.g. workspace ID directly is edge cases like [very_long_slug]--[workspace_id]--long-subdomain-suffix.

@github-actions github-actions bot added the stale This issue is like stale bread. label Jun 20, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
@mingfang
Copy link

what is the solution to this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2 Broken use cases or features (with a workaround). Only humans may set this. stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants