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

File name too long #129372

Open
antonio-tg opened this issue Dec 23, 2024 · 9 comments
Open

File name too long #129372

antonio-tg opened this issue Dec 23, 2024 · 9 comments
Labels
kind/support Categorizes issue or PR as a support question. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@antonio-tg
Copy link

antonio-tg commented Dec 23, 2024

What happened?

Hi guys,

I need your help with something really weird. I have JupyterHub in an Openshift production environment and one of my users created a notebook with a really long name. Everything was fine, until the next day when he failed to initialize his pod due to this error:

Captura desde 2024-12-23 11-25-39

So if you can help me with this, I would really appreciate it.

What did you expect to happen?

Start as usual

How can we reproduce it (as minimally and precisely as possible)?

Create a file with a very long name

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
v4.5.7

Cloud provider

ARO ~ Azure Rethad Openshift

OS version

# On Linux:
$ cat /etc/os-release
# "Ubuntu 22.04.1 LTS"
$ uname -a
# Linux UBUNTU-MNGR 6.8.0-1018-azure #21~22.04.1-Ubuntu SMP Fri Nov  8 00:21:25 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

I'm using:

JupyterHub: 4.0.2
Image: datascience-notebook:python-3.11.7
Openshift: 4.15.27
Kubernetes: v1.28.11+add48d0
Helm chart: https://hub.jupyter.org/helm-chart version 3.2.1
@antonio-tg antonio-tg added the kind/bug Categorizes issue or PR as related to a bug. label Dec 23, 2024
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 23, 2024
@k8s-ci-robot
Copy link
Contributor

There are no sig labels on this issue. Please add an appropriate label by using one of the following commands:

  • /sig <group-name>
  • /wg <group-name>
  • /committee <group-name>

Please see the group list for a listing of the SIGs, working groups, and committees available.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 23, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@sftim
Copy link
Contributor

sftim commented Dec 23, 2024

/remove-kind bug
/kind support

You could reframe this as a bug report @antonio-tg but right now the level of detail is not there to allow someone to reproduce it and then work on it.

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels Dec 23, 2024
@antonio-tg
Copy link
Author

Dear @sftim I just added some new information, hoping it will be sufficient.

@carlory
Copy link
Member

carlory commented Dec 24, 2024

The "file name too long" error you're encountering is generally a kernel limitation related to PATH_MAX, which is typically 4096 bytes.

root@kind-control-plane:/# getconf PATH_MAX /var
4096

@carlory
Copy link
Member

carlory commented Dec 24, 2024

The provided path contains so many repeated path segments. 🤔

@thisisharrsh
Copy link

We can replace long notebook names with a hash or truncate them that ensures the name remains unique but significantly shorter.

@thisisharrsh
Copy link

I think a simple Python function can do the job.

@thisisharrsh
Copy link

def shorten_name(name):
    return hashlib.sha256(name.encode('utf-8')).hexdigest()[:16]

short_name = shorten_name(long_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

5 participants