-
Type: Epic
-
Status: Open
-
Priority: Critical
-
Resolution: Unresolved
-
Affects Version/s: 3.7.0
-
Fix Version/s: None
-
Component/s: Production Incident, Versioning & Branch management
-
Tags:
-
Completion Level (0 to 5):4
ERROR-1 Invalid ref name: HEAD
Overview
The characteristic stack trace of the problem:
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Invalid ref name: HEAD at org.eclipse.jgit.api.ResetCommand.call(ResetCommand.java:170) at com.nuxeo.studio.core.versioning.VersioningAbstract.resetOnHead(VersioningAbstract.java:452) at com.nuxeo.studio.core.versioning.VersioningAbstract.resetOnBranch(VersioningAbstract.java:463)
Unfortunately, we don't know the cause of the problem.
Related issues:
- NXS-5116 Fix error with package "vf-corp-4d-demo"
NXS-5212Fix Invalid ref name: HEAD
Action points:
- NXS-5125 Improve log message when JGit internal exception occurs
- NXS-5226 Improve workspace reset mechanism
NXS-5245Remove corrupted workspaces from workspaces pool
More Detail
JGit internal exception (JGitInternalException) is thrown when Git reference is resolved correctly but the commit ID is not (https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java#L165-L172):
final ObjectId commitId = resolveRefToCommitId(); // When ref is explicitly specified, it has to resolve if (ref != null && commitId == null) { // @TODO throw an InvalidRefNameException. We can't do that // now because this would break the API throw new JGitInternalException(MessageFormat .format(JGitText.get().invalidRefName, ref)); }
It means that Git head file (.git/HEAD) points to an existing Git reference, but this reference fails to point to a valid commit. For example, if the content of head file (.git/HEAD) is ref: refs/heads/master, it means that it points to master branch. But perhaps master branch points to an unknown commit. I don't know how it can be possible, but it sounds like we have data corruption here.
ERROR-2 Exception caught during execution of reset command.
The characteristic stack trace of the problem:
org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of reset command. Creating directories for /ebs/studio_workspaces/monique-2019-10-10-nuxeo/monique-2019-10-10-nuxeo-#1681-cloned-2019-03-01-15-23-18/studio/resources/nuxeo.war/ui/layouts failed at org.eclipse.jgit.api.ResetCommand.call(ResetCommand.java:242) at com.nuxeo.studio.core.versioning.VersioningAbstract.resetOnHead(VersioningAbstract.java:456) at com.nuxeo.studio.core.versioning.VersioningAbstract.resetOnBranch(VersioningAbstract.java:468) at com.nuxeo.studio.core.workspace.WorkspaceProvider.switchToBranch(WorkspaceProvider.java:224) ... Caused by: java.io.IOException: Creating directories for /ebs/studio_workspaces/monique-2019-10-10-nuxeo/monique-2019-10-10-nuxeo-#1681-cloned-2019-03-01-15-23-18/studio/resources/nuxeo.war/ui/layouts failed at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:398) at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1451) at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:577) at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:484) at org.eclipse.jgit.api.ResetCommand.checkoutIndex(ResetCommand.java:447) at org.eclipse.jgit.api.ResetCommand.call(ResetCommand.java:215) ... 117 more
This is not a JGit bug. JGit is a side-effect. It is caused by an incorrect file called "layouts" created by user.
Related issues:
- NXS-5233 Creating directories for /path/to/nuxeo.war/ui/layouts failed
ERROR-3 MissingObjectException: Missing unknown $SHA1
NXS-5234
ERROR-4 Exception caught while accessing pack file $FILE
NXS-5254, I think it's related to ERROR-3 where both tickets are about missing files (objects or packs).