openSUSE / open-build-service

Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
https://openbuildservice.org
GNU General Public License v2.0
924 stars 436 forks source link

Improve error message when Unicode is rejected #12344

Closed jengelh closed 5 months ago

jengelh commented 2 years ago

Observed:

» cat 1
<project name="home:jengelh">
  <title>jeng's Home Project</title>
  <description>x</description>
  <person userid="jengelh" role="bugowner"/>
  <person userid="jengelh" role="maintainer"/>
  <publish>
    <enable/>
  </publish>
  <repository name="burger🍔">
    <path project="openSUSE:Factory" repository="standard"/>
    <arch>x86_64</arch>
  </repository>
</project>

» osc meta prj home:jengelh -F 1
PUT https://api.opensuse.org/source/home%3Ajengelh/_meta
Server returned an error: HTTP Error 500: Internal Server Error
Date: Thu, 24 Mar 2022 11:33:06 GMT
Server: Apache/2.4.51 (Linux/SUSE)
Strict-Transport-Security: max-age=31536000
x-request-id: 0f899c7a-4da3-4bcb-9d16-afddc5861941
x-runtime: 0.430667
x-powered-by: Phusion Passenger(R) 6.0.12
content-length: 131
status: 500 Internal Server Error
content-type: application/xml; charset=utf-8
Connection: close

b'<?xml version="1.0" encoding="UTF-8"?>\n<hash>\n  <status type="integer">500</status>\n  <error>Internal Server Error</error>\n</hash>\n'

Request: https://api.opensuse.org/source/home%3Ajengelh/_meta
Headers:
Date: Thu, 24 Mar 2022 11:33:06 GMT
Server: Apache/2.4.51 (Linux/SUSE)
Strict-Transport-Security: max-age=31536000
x-request-id: 0f899c7a-4da3-4bcb-9d16-afddc5861941
x-runtime: 0.430667
x-powered-by: Phusion Passenger(R) 6.0.12
content-length: 131
status: 500 Internal Server Error
content-type: application/xml; charset=utf-8
Connection: close

Expected to see: something along the lines of

b'<status code="400" origin="backend">\n  <summary>repoid \'..\' is illegal</summary>\n</status>'
repoid '..' is illegal
b'<status code="invalid_record">\n  <summary>Name must not start with \'_\' or contain any of these characters \':/\'</summary>\n</status>\n'
Name must not start with '_' or contain any of these characters ':/'
hellcp-work commented 5 months ago

image It doesn't error out anymore