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

Upload of raw repository adds local folder structure to the repo contents (Windows dirsep issue?) #681

Open
Zastai opened this issue Jan 2, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Zastai
Copy link

Zastai commented Jan 2, 2025

What happened:
Backed up a hosted raw repository called raw-internal on an old Nexus instance (running v3.40.0).
Used directory prefix data, so files ended up under data/raw-internal/.
Uploaded that backup to a new Nexus instance (running v3.75.1); no errors were reported.
However, the data/raw-internal/ portion of the local backup file path is now included in the repo contents (see screenshot below).
(Note that the repo has backslashes in the item name instead of representing these as tree nodes, so I am guessing this is just a case of N3DR not handling windows directory separators correctly in this case.)

What you expected to happen:
The new raw-internal repository contents match the old contents.

How to reproduce it (as minimally and precisely as possible):
I would expect it to be reproducible with any raw repository that includes a directory structure.

Anything else we need to know?:
Screenshot on old Nexus before backup:
image

Screenshot on new Nexus after upload:
image

Environment:

  • nexus version: 3.40.0 (old), 3.75.1 (new)
  • n3dr version (use n3dr -v): 7.6.0 (note: this should say to use n3dr --version; -v sets the API version)
  • OS (e.g: cat /etc/os-release): Windows 11
  • Kernel (e.g. uname -a): build 22621.4460
@Zastai Zastai added the bug Something isn't working label Jan 2, 2025
@Zastai
Copy link
Author

Zastai commented Jan 2, 2025

Looking in the Nexus logs I see entries with "domain":"repository.asset","type":"created","context":"/data\\raw-internal\\conversion-factory-natural-adabas-to-dotnet/conversion-factory-natural-adabas-to-dotnet-2.1.0.zip" which would seem to confirm there is dirsep mishandling involved.

@Zastai
Copy link
Author

Zastai commented Jan 2, 2025

Looks like the issue is located here

The 'dir' variable substitutes "{local repo dir}/" with "", but that won't work on a path that has backslashes in it.

What's more, that would mean that if the repo in my case had even more structure, like:

+ top-level
  + subfolder1
    - some-artifact
  + subfolder2
    + more
      + structure
        - some-other-artifact
  - top-level-artifact

it would get uploaded as

+ data\reponame\top-level
  - top-level-artifact
+ data\reponame\top-level\subfolder1
  - some-artifact
+ data\reponame\top-level\subfolder2\more\structure
  - some-other-artifact

@Zastai
Copy link
Author

Zastai commented Jan 2, 2025

(Note that I tried to work around this by using the ubuntu binary from WSL, but then I had connection issues, likely due to the corporate proxy; setting $http_proxy and $HTTP_PROXY did not help there.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant