Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug HTTP Status code 405 when using GitHub's NPM registry as scoped registry

Discussion in 'Package Manager' started by KageKirin, Oct 1, 2021.

  1. KageKirin

    KageKirin

    Joined:
    Jan 22, 2014
    Posts:
    50
    Hi,

    this is an issue I get when using GitHub’s NPM registry as Scoped Registry with UPM.
    The issue looks it's on GitHub's side, as it only occurs with GitHub’s (and GitHub Enterprise’s) registries, but since Unity is doing the unsupported queries, I might file it as well here.

    This is the error message printed by Unity:


    [Package Manager Window] Cannot perform upm operation: Unable to perform online search:
    Request [GET https://npm.pkg.github.com/@ KageKirin/-/v1/search?text=com.kagekirin&from=0&size=250] failed with status code [405]


    The UPM’s manifest.json has the scoped registry set up like this


    {
    "scopedRegistries": [
    {
    "name": "GitHub Packages (KageKirin)",
    "url": "https://npm.pkg.github.com/@ KageKirin/",
    "scopes": [
    "com.kagekirin"
    ]
    }
    ],
    "dependencies": {
    "com.kagekirin.createurpshaders": "1.0.6",
    }
    }


    So far, this setup works to fetch my package from the registry where I published it,
    but it would be lovely not to get the error spam about failed searches.

    Thanks for any help.

    EDIT: Clean up tags added by this forum system.
    EDIT: Added a space after @ and my user name to avoid user-tags being added where they don't belong.
     
  2. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    490
    Hi @KageKirin,

    Yes, this is indeed because the Github.com registry service doesn't support the npm search APIs (or more accurately, it explicitly denies serving them). There is no work currently planned to change this.

    I am taking a note of your feedback however and we'll discuss internally if anything can be done to improve the experience with non-conformant npm registries.
     
  3. KageKirin

    KageKirin

    Joined:
    Jan 22, 2014
    Posts:
    50
    Thanks for the reply.
    For the record, I asked the same question on GitHub side: https://github.community/t/npm-unity-and-http-status-code-405/204039
    Maybe they can come up with a solution.

    As a workaround, may I suggest just adding a binary flag to the scoped registry entry, e.g. "allowSearch", which when set to false would just not call the search API?

    Cheers.
     
    snakehound00 and maximeb_unity like this.
  4. joet_9

    joet_9

    Joined:
    Oct 13, 2022
    Posts:
    2
    Has any discovered any solutions or workarounds for this issue?