Cannot fit name [.../sbt-load.sock] in maximum unix domain socket length

Abierto
#75 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
java

Línea de trabajo

Reproduce el fallo con el comando de sbt mostrado y un java.io.tmpdir largo; después, sigue cómo se selecciona la ruta del socket y cómo la excepción se convierte en ServerAlreadyBootingException. El issue no menciona archivos fuente ni tests, y todavía hay que confirmar el comportamiento esperado de fallback frente al de error; la tarea debería considerarse terminada cuando exista un manejo claro y acordado para las rutas que superen los límites de los sockets Unix.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

steps

  • create an sbt build with a medium deeply-nested folder structure
  • try to run a simple command with java.io.tmpdir set to the base folder of the build

In our case it ends up being something like

sbt -Djava.io.tmpdir=/var/lib/jenkins/workspace/some-very-long-branch-name/target/tmp clean

problem

The above command produces the following error message:

sbt thinks that server is already booting because of this exception:
sbt.internal.ServerAlreadyBootingException: java.io.IOException: org.scalasbt.ipcsocket.NativeErrorException: Cannot fit name [/var/lib/jenkins/workspace/some-very-long-branch-name/target/tmp/.sbt/sbt-socket8737049473820614565/sbt-load.sock] in maximum unix domain socket length

I think the issue is caused by sbt/sbt#6887 - although we don't set XDG_RUNTIME_DIR explicitly, I wonder if the code is somehow falling back to java.io.tmpdir.

There is a secondary issue that the error message is slightly misleading ("sbt thinks that the server is already booting") - would it be possible to separate out "the lock file already exists" from other cases such as this one? (I guess the same issue would happen if e.g. the current user didn't have permission to create the lock file in the given location).

expectation

Not sure what the expected behaviour is here. I see there's some discussion on sbt/sbt#7013 about always (?) using /tmp instead, which would be preferable since the socket name is then guaranteed to always be short enough.

Alternatively sbt could pre-check the proposed socket name length (or catch the exception?) and handle it gracefully - either by falling back to /tmp or else giving a helpful error message?

notes

We can work around the issue by also explicitly setting XDG_RUNTIME_DIR to something shorter (e.g. a known folder under /tmp) but this is mildly annoying since we'd ideally like to have a single temp directory under our build Jenkins workspace folder.

Lenguaje dominante
Java
Estrellas
58
Forks
20
Merge medio
12 h 39 min
PR fusionados (30 d)
11

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sbt/ipcsocket

Todos los issues de sbt/ipcsocket

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.