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

unable to parse package name containing local version specifier #944

Closed
ChristopherRussell opened this issue Jun 22, 2024 · 6 comments
Closed

Comments

@ChristopherRussell
Copy link

Hello. I shared the below on prefix.dev discord and @baszalmstra suggested I make an issue. They said:

The specified package contains a local version specifier (+218-0). In general these should not be distributed. But I think we should be able to handle them properly regardless.

My situation: I have been trying out pixi at work for the first time. We install everything from internal conda channels. I suppose some bad versions get into there sometimes. E.g. "libxgboost-0.6+218-0.tar.bz2", which caused me to get the following error via pixi add <some_package>:

ERROR resolve_conda{group=default, platform=linux-64}: rattler_repodata_gateway::gateway: error=failed to parse repodata.json
  x failed to parse repodata.json
    -> invalid filename at line 38856 column 38 

I shall request to get these removed from our conda channels now that I am aware, however I think it'd be nice to handle since this error blocks me in the meantime.

@wolfv
Copy link
Member

wolfv commented Jun 24, 2024

This is actually an issue for rattler (not rattler-build) if I understand correctly :)

Although it would be interesting to test that rattler-build does not put the local version in the filename.

@wolfv
Copy link
Member

wolfv commented Jun 24, 2024

PS: can you open the issue here as well? https://github.com/mamba-org/rattler

@wolfv
Copy link
Member

wolfv commented Jun 24, 2024

@ChristopherRussell I investigated a bit more and I am not sure wether the local version is really the problem.

Can you double check if you have any packages with fewer than two dashes in them?

The code looks like the following:

let package = s.rsplitn(3, '-').nth(2).ok_or("invalid filename")?;

We expect a package filename to look like foo-1.2.3-0.tar.bz2 or foo-1.2.3-hash_0.tar.bz2 or foo-base-1.2.3-hash_0.conda (i.e. to have at least two dashes). The dashes split name, version and build string.

I'll also adjust the error message to mention missing dashes.

@wolfv
Copy link
Member

wolfv commented Jun 24, 2024

@ChristopherRussell - I opened a PR that might improve the error message here: conda/rattler#757

If you find the offending package, can you let us know? We could think about making the parsing more lenient and adding a fallback if only a single - is found. Or no - is found ...

@ChristopherRussell
Copy link
Author

ChristopherRussell commented Jun 25, 2024

Thanks for investigating and opening the other issue for me!

The error message was:

invalid filename at line 38856 column 38

and the snippet below shows the entry starting at the 38856'th line (or 'line 38855' if you call the first line 'line 0'). I don't think the error refers to the previous line though as it's only a few characters long (a few spaces plus a close bracket). We also have noarch and win-64 sections in the channel, but the repodata.json files for those are shorter than 38856 lines so can't be the cause of the error.

    },
    "libxgboost-0.6+218_omp_0.tar.bz2": {     <---- Line 38856
      "build": "0",
      "build_number": 0,
      "depends": [],
      "extra": {
        "git": {
          "branch": "HEAD",
          "commit": "2715bae",
          "sha": "2715baef64c07546314977caf858d1cce1043b66"
        },
        "package": {
          "md5": "43b62a5ba9470354c6244353bfcad65d"
        },
        "system": {
          "cwd": "/some/path/to/a/dir",
          "node": "name.company.com",
          "os": "Linux",
          "prefix": "/some/path",
          "time": "2017-04-06 14:13:26.296584",
          "user": "some_user"
        },
        "versions": {
         "conda": "4.1.12",
          "conda-build": "1.21.7",
          "conda-tox": "0.6.5",
          "python": "3.5.2"
        }
      },
      "features": "omp",
      "md5": "477ec8a7faa700d27138e1cdf8fec967",
      "name": "libxgboost",
      "sha256": "4005a7034a294aa0d063aa5c4273f09e21cd04e1997e436f5bf0aada7e5c91da",
      "size": 912390,
      "subdir": "linux-64",
      "version": "0.6+218"
    },

@wolfv
Copy link
Member

wolfv commented Aug 1, 2024

I think this is fixed in rattler. Thanks again for the bug report!

@wolfv wolfv closed this as completed Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants