Internal Server Error when trying to access npm packages #9385

Closed
opened 2025-11-02 08:37:09 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @zoe-codez on GitHub (Aug 10, 2022).

Description

I cannot access the details of any of the NPM packages being published from my server from the web UI. Url: /mp3three/-/packages/npm/@steggy%2Fhome-assistant/22.33.13

The published docker container seems fine, currently all of my npm packages are giving 500 errors. I am able to interact with them just fine via yarn (install, upgrade, etc), and there are no issues deleting the packages from the site management screen. Every time that I load the page giving me the 500 error, I get this line in the logs:

...s/context/context.go:232:HTML() [E] [62f40b0b] Render failed: template: package/metadata/npm:5:27: executing "package/metadata/npm" at <.PackageDescriptor.Properties>: can't evaluate field Properties in type interface {}

This is an an example package.json that was published with one of the packages:

{
  "author": {
    "name": "mp3three"
  },
  "name": "@steggy/home-assistant",
  "displayName": "Home Assistant",
  "license": "MIT",
  "version": "22.33.13",
  "scripts": {
    "postinstall": "npx hass-type-generate"
  },
  "main": "./src/index.js",
  "typings": "./src/index.d.ts",
  "dependencies": {
    // ...
  },
  "peerDependencies": {}
}

Gitea Version

gitea/gitea:latest docker image (1.17.0)

Can you reproduce the bug on the Gitea demo site?

  • Still waiting on demo site email to sign up

Log Gist

No response

Screenshots

2022-08-10_15-10

Git Version

No response

Operating System

Debian > Docker > Gitea

How are you running Gitea?

gitea/gitea:latest as of the time of opening this issue

Database

MySQL

Originally created by @zoe-codez on GitHub (Aug 10, 2022). ### Description I cannot access the details of any of the NPM packages being published from my server from the web UI. Url: `/mp3three/-/packages/npm/@steggy%2Fhome-assistant/22.33.13` The published docker container seems fine, currently all of my npm packages are giving 500 errors. I am able to interact with them just fine via yarn (install, upgrade, etc), and there are no issues deleting the packages from the site management screen. Every time that I load the page giving me the 500 error, I get this line in the logs: ``` ...s/context/context.go:232:HTML() [E] [62f40b0b] Render failed: template: package/metadata/npm:5:27: executing "package/metadata/npm" at <.PackageDescriptor.Properties>: can't evaluate field Properties in type interface {} ``` This is an an example `package.json` that was published with one of the packages: ```json { "author": { "name": "mp3three" }, "name": "@steggy/home-assistant", "displayName": "Home Assistant", "license": "MIT", "version": "22.33.13", "scripts": { "postinstall": "npx hass-type-generate" }, "main": "./src/index.js", "typings": "./src/index.d.ts", "dependencies": { // ... }, "peerDependencies": {} } ``` ### Gitea Version gitea/gitea:latest docker image (1.17.0) ### Can you reproduce the bug on the Gitea demo site? - Still waiting on demo site email to sign up ### Log Gist _No response_ ### Screenshots ![2022-08-10_15-10](https://user-images.githubusercontent.com/35661840/184010667-da998d37-3e06-472e-b354-0042a454d719.png) ### Git Version _No response_ ### Operating System Debian > Docker > Gitea ### How are you running Gitea? gitea/gitea:latest as of the time of opening this issue ### Database MySQL
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 08:37:09 -06:00
Author
Owner

@silverwind commented on GitHub (Aug 11, 2022):

I think it's because package is missing a description, we should handle this gracefully.

@silverwind commented on GitHub (Aug 11, 2022): I think it's because package is missing a `description`, we should handle this gracefully.
Author
Owner

@zoe-codez commented on GitHub (Aug 11, 2022):

I purged all my existing packages, added added a description to this one as a test, and published again. Still receiving a 500 error

{
  "author": {
    "name": "mp3three"
  },
  "name": "@steggy/home-assistant",
  "displayName": "Home Assistant",
  "license": "MIT",
  "version": "22.33.13",
  "scripts": {
    "postinstall": "npx hass-type-generate"
  },
  "description": "HELLO WORLD",
  "main": "./src/index.js",
  "typings": "./src/index.d.ts",
  "dependencies": {
    // ...
  },
  "peerDependencies": {}
}

Is there other fields I am missing?

@zoe-codez commented on GitHub (Aug 11, 2022): I purged all my existing packages, added added a description to this one as a test, and published again. Still receiving a 500 error ```json { "author": { "name": "mp3three" }, "name": "@steggy/home-assistant", "displayName": "Home Assistant", "license": "MIT", "version": "22.33.13", "scripts": { "postinstall": "npx hass-type-generate" }, "description": "HELLO WORLD", "main": "./src/index.js", "typings": "./src/index.d.ts", "dependencies": { // ... }, "peerDependencies": {} } ``` Is there other fields I am missing?
Author
Owner

@silverwind commented on GitHub (Aug 11, 2022):

Then my assumption is wrong. Your data looks fine. I think the minimum required properties should be just name and version.

@silverwind commented on GitHub (Aug 11, 2022): Then my assumption is wrong. Your data looks fine. I think the minimum required properties should be just `name` and `version`.
Author
Owner

@KN4CK3R commented on GitHub (Aug 11, 2022):

Duplicate of https://github.com/go-gitea/gitea/issues/20670

But I missed to create a backport for that PR.

@KN4CK3R commented on GitHub (Aug 11, 2022): Duplicate of https://github.com/go-gitea/gitea/issues/20670 But I missed to create a backport for that PR.
Author
Owner

@silverwind commented on GitHub (Aug 11, 2022):

Is it? Seems unrelated to unpublish here.

@silverwind commented on GitHub (Aug 11, 2022): Is it? Seems unrelated to unpublish here.
Author
Owner

@lafriks commented on GitHub (Aug 11, 2022):

I think this was fixed by #20675, it just referenced wrong issue it fixed

@lafriks commented on GitHub (Aug 11, 2022): I think this was fixed by #20675, it just referenced wrong issue it fixed
Author
Owner

@KN4CK3R commented on GitHub (Aug 11, 2022):

No, #20670 has the 500 error too. The unpublish was another feature request extracted from #20670

@KN4CK3R commented on GitHub (Aug 11, 2022): No, #20670 has the 500 error too. The unpublish was another feature request extracted from #20670
Author
Owner

@zoe-codez commented on GitHub (Aug 11, 2022):

I am able to confirm this issue is resolved already. Built a docker container from HEAD, and the page properly loads. I'm guessing the next real build will have the fix

Thank you all

@zoe-codez commented on GitHub (Aug 11, 2022): I am able to confirm this issue is resolved already. Built a docker container from HEAD, and the page properly loads. I'm guessing the next real build will have the fix Thank you all
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9385