Skip to content

Internal Server Error when trying to access npm packages #20755

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

Closed
zoe-codez opened this issue Aug 10, 2022 · 8 comments
Closed

Internal Server Error when trying to access npm packages #20755

zoe-codez opened this issue Aug 10, 2022 · 8 comments

Comments

@zoe-codez
Copy link

zoe-codez commented 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

@silverwind
Copy link
Member

silverwind commented Aug 11, 2022

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

@silverwind silverwind added the topic/distribution This PR changes something about the packaging of Gitea label Aug 11, 2022
@zoe-codez
Copy link
Author

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?

@silverwind
Copy link
Member

silverwind commented Aug 11, 2022

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

@lunny lunny added topic/packages and removed topic/distribution This PR changes something about the packaging of Gitea labels Aug 11, 2022
@lunny lunny added this to the 1.17.1 milestone Aug 11, 2022
@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 11, 2022

Duplicate of #20670

But I missed to create a backport for that PR.

@KN4CK3R KN4CK3R closed this as completed Aug 11, 2022
@silverwind
Copy link
Member

Is it? Seems unrelated to unpublish here.

@lafriks
Copy link
Member

lafriks commented Aug 11, 2022

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

@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 11, 2022

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

@zoe-codez
Copy link
Author

zoe-codez commented 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

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants