UnityPackageManager.exe fails to download a package from my package repository

I set up my own UPM repository with Gitea and uploaded a custom package.

When I try to install the package UnityPackageManager.exe fails to download it:

[2024-11-24T13:48:55.938Z][INFO] Command-line: 'C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.50f1\\Editor\\Data\\Resources\\PackageManager\\Server\\UnityPackageManager.exe' -s 63356 -ipc -ipc-path Unity-Upm-63356 -l 2
[2024-11-24T13:48:55.959Z][INFO] IPC server started (IPC path=Unity-Upm-63356).
[2024-11-24T13:48:55.959Z][INFO] Hint: To connect to this UPM instance, launch Unity with the command-line parameter -upmIpcPath Upm-63356.
[2024-11-24T13:48:56.032Z][INFO] project:resolve-packages <-- Request received
params: {}
[2024-11-24T13:49:18.130Z][INFO] Downloading package [com.■■■■■■■■■■■■.extensions.generichost@1.0.0] from registry 'https://git.■■■■■■■■■■■■.com/api/packages/■■■■■■■■■■■■/npm'
[2024-11-24T13:49:18.140Z][INFO] Downloading package [com.■■■■■■■■■■■■.extensions.configuration@1.0.0] from registry 'https://git.■■■■■■■■■■■■.com/api/packages/■■■■■■■■■■■■/npm'
[2024-11-24T13:49:18.142Z][INFO] Downloading package [com.■■■■■■■■■■■■.extensions.logging@1.0.0] from registry 'https://git.■■■■■■■■■■■■.com/api/packages/■■■■■■■■■■■■/npm'
[2024-11-24T13:49:39.183Z][ERROR] Failed to download package from URL: 'https://git.■■■■■■■■■■■■.com:3000/api/packages/■■■■■■■■■■■■/npm/com.■■■■■■■■■■■■.extensions.generichost/-/1.0.0/com.■■■■■■■■■■■■.extensions.generichost-1.0.0.tgz': Error: connect ETIMEDOUT ■■■.■■■.■■■.■■■:3000
[2024-11-24T13:49:39.192Z][ERROR] Failed to download package from URL: 'https://git.■■■■■■■■■■■■.com:3000/api/packages/■■■■■■■■■■■■/npm/com.■■■■■■■■■■■■.extensions.configuration/-/1.0.0/com.■■■■■■■■■■■■.extensions.configuration-1.0.0.tgz': Error: connect ETIMEDOUT ■■■.■■■.■■■.■■■:3000
[2024-11-24T13:49:39.193Z][ERROR] Failed to download package from URL: 'https://git.■■■■■■■■■■■■.com:3000/api/packages/■■■■■■■■■■■■/npm/com.■■■■■■■■■■■■.extensions.logging/-/1.0.0/com.■■■■■■■■■■■■.extensions.logging-1.0.0.tgz': Error: connect ETIMEDOUT ■■■.■■■.■■■.■■■:3000
[2024-11-24T13:49:39.282Z][WARN] Requested version [1.2.1] for package [com.unity.mathematics] overridden by minimum version [1.2.6].
[2024-11-24T13:49:39.283Z][WARN] Requested version [1.8.9] for package [com.unity.burst] overridden by minimum version [1.8.18].
[2024-11-24T13:49:39.283Z][WARN] Requested version [14.0.9] for package [com.unity.render-pipelines.universal-config] overridden by minimum version [14.0.10].
[2024-11-24T13:49:39.284Z][INFO] project:resolve-packages --> 200 (43252 ms)
[2024-11-24T13:49:58.587Z][INFO] Shutting down UnityPackageManager.exe: parent process [63356] is no longer running.

npm installs the package just fine.

Why does UnityPackageManager.exe try to connect to the 3000 port? Is it something misconfigured on my server or it’s a default port for the UPM?

Scoped registry in my manifest.json looks like this:

"scopedRegistries": [
    {
      "name": "MyPackages",
      "url": "https://git.■■■■■■■■■■■■.com/api/packages/■■■■■■■■■■■■/npm/",
      "scopes": [
        "com.■■■■■■■■■■■■"
      ]
    }
  ]

It looks like Unity can connect to your server and query the packages, only the download of the package tarball fails. The tarball URL is sent by the registry, so I’d suspect your registry is sending the URL with the 3000 port number.

Not sure why it works with npm, maybe the registry is sending different URLs based on the client or npm somehow disregards the port number? Or the port is correct and Unity fails for some other reason?

The best would be to use a HTTP proxy to monitor the traffic and see exactly what Unity and npm receive from the registry.

Thanks, I’ll check Gitea documentation again.

Here’s what I found so far:

npm fetches my package json:

npm http fetch GET 200 https://git.■■■■■■■■■■.com/api/packages/■■■■■■■■■■/npm/com.kirill-vorotov.extensions.generichost 406ms (cache updated)

The json looks like this:

{
    "_id": "com.■■■■■■■■■■.extensions.generichost",
    "name": "com.■■■■■■■■■■.extensions.generichost",
    "description": "",
    "dist-tags": {
        "latest": "1.0.0"
    },
    "versions": {
        "1.0.0": {
            "_id": "com.■■■■■■■■■■.extensions.generichost@1.0.0",
            "name": "com.■■■■■■■■■■.extensions.generichost",
            "version": "1.0.0",
            "description": "",
            "author": {
                "name": "■■■■■■■■■■ ■■■■■■■■■■"
            },
            "repository": {
                "type": "",
                "url": ""
            },
            "dependencies": {
                "com.■■■■■■■■■■.extensions.configuration": "1.0.0",
                "com.■■■■■■■■■■.extensions.logging": "1.0.0"
            },
            "readme": "ERROR: No README data found!",
            "dist": {
                "integrity": "■■■■■■■■■■",
                "shasum": "■■■■■■■■■■",
                "tarball": "https://git.■■■■■■■■■■.com/api/packages/■■■■■■■■■■/npm/com.■■■■■■■■■■.extensions.generichost/-/1.0.0/com.■■■■■■■■■■.extensions.generichost-1.0.0.tgz"
            }
        }
    },
    "readme": "ERROR: No README data found!",
    "repository": {
        "type": "",
        "url": ""
    },
    "author": {
        "name": "■■■■■■■■■■ ■■■■■■■■■■"
    }
}

As you can see, port is not included:

"tarball": "https://git.■■■■■■■■■■.com/api/packages/■■■■■■■■■■/npm/com.■■■■■■■■■■.extensions.generichost/-/1.0.0/com.■■■■■■■■■■.extensions.generichost-1.0.0.tgz"

And then npm successfully downloads a tarball from

https://git.■■■■■■■■■■.com/api/packages/■■■■■■■■■■/npm/com.■■■■■■■■■■.extensions.generichost/-/1.0.0/com.■■■■■■■■■■.extensions.generichost-1.0.0.tgz

Soooo, I guess it’s UPM quirk, because port 3000 is blocked by the firewall and event not mapped in the docker compose file. idk.

Strange, this doesn’t happen with my registry server.

Did you try to capture Unity’s network traffic? Just to make sure there isn’t a difference in how Unity requests packages that would cause the server to return a different tarball URL.

Do you use scoped registry authentication? Does the registry URL in Packages/manifest.json maybe include the port?

Of course right after the moment I published the update it magically fixed itself :smiley:

So, I was trying to figure out what was happening. I removed the package from dependencies in the manifest.json and launched the project. In the package manager window (in the editor) I could see my packages under the scoped registry.

I added my package back and it… just worked?

I tried the same registry and the same manifest.json on two different machines with no luck.

I’m gonna blame some nginx cache not being updated on the server because I have no idea at this point.

1 Like