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

Skip to content

bug: coder_app DNS label must not exceed 64 characters to avoid NXDOMAIN #9518

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
johnstcn opened this issue Sep 4, 2023 · 2 comments
Closed
Labels
s2 Broken use cases or features (with a workaround). Only humans may set this.

Comments

@johnstcn
Copy link
Member

johnstcn commented Sep 4, 2023

Problem:

DNS entries consist of labels separated by a period (.), where each label may be up to 64 characters in length.

When exposing a coder_app, we forward requests that match the DNS label <app_name>.<agent-name>.<workspace_name>.<user_name>. Unfortunately, this can exceed 63 characters.

Result: confusion as to why a coder_app in one workspace works, and another with a longer name is inaccessible with an NXDOMAIN error.

Possible Solutions

1. Validate at workspace planning stage

When creating a workspace, enforce an upper limit on the length of a coder_app such that len(app.Name) + len(agent.Name) + len(workspace.Name) + len(user.Username) < 65. This would be detected at the Terraform plan stage.

Note: There is a pathological case here where one or more of the above fields already add up to more than 64 characters. We could potentially also add upper limits on the length of the component fields, but this becomes problematic in the case of OIDC logins where we automatically generate the username based on claims.

@johnstcn johnstcn added s2 Broken use cases or features (with a workaround). Only humans may set this. bug labels Sep 4, 2023
@johnstcn johnstcn changed the title bug: coder_app DNS label can end up being too long bug: coder_app DNS label must not exceed 64 characters to avoid NXDOMAIN Sep 4, 2023
@matifali
Copy link
Member

matifali commented Sep 4, 2023

Is it different or related to #8145?

@johnstcn
Copy link
Member Author

johnstcn commented Sep 4, 2023

Nice find @matifali ! I looked before opening this issue but missed that one.
Duplicates #8145

@johnstcn johnstcn closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2023
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.
Projects
None yet
Development

No branches or pull requests

2 participants