Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-6150

Misleading message printed when IOException is thrown trying to lock nexus.lock file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7, 2.8
    • Component/s: Bootstrap
    • Labels:
      None
    • Sprint:
      Sprint 7, Sprint 8

      Description

      In LockFile we have:

          try {
            randomAccessFile = new RandomAccessFile(lockFile, "rws");
            fileLock = randomAccessFile.getChannel().tryLock(0L, 1L, false);
            if (fileLock != null) {
              randomAccessFile.setLength(0);
              randomAccessFile.seek(0);
              randomAccessFile.write(payload);
            }
          }
          catch (IOException | OverlappingFileLockException e) {
            // handle it as null result
            fileLock = null;
          }
      
      

      And in PlexusContextListener:

              lockFile = new LockFile(new File(nexusWorkdir, "nexus.lock"));
              if (!lockFile.lock()) {
                throw new IllegalStateException("Nexus work directory already is use!");
              }
      

      So any IOException that gets thrown ends up as saying work directory is in use. And the caused by exception isn't even set.

      This is going to cause a lot of support tickets.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title