Skip to content
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

Nexus 3.77.1 with API installation , EULA issue "Invalid UTF-8 start byte 0x91" #572

Open
Exether opened this issue Feb 11, 2025 · 0 comments

Comments

@Exether
Copy link

Exether commented Feb 11, 2025

I am maintaining an automated Nexus installation on kubernetes with a git bash script running on windows. With the recent 3.77.1 version, it is required to accept end use licence which can be done via the REST API.

My issue is that the script I wrote to do this EULA acceptance fails with an error I don't understand.

My issue is that when I do it via this script:

# Retrieve licence data and update acceptance
EULA_FILE="$(mktemp)_EULA.json"
curl -s -X GET -u "admin:$NEXUS_PASSWD"  -H "accept: application/json" "$NEXUS_URL/service/rest/v1/system/eula" | sed 's/: false/: true/g' > $EULA_FILE
# Send back acceptance
curl -v -s -X POST -u "admin:$NEXUS_PASSWD" -H "Content-Type: application/json; charset=UTF-8" -d "$(cat $EULA_FILE | sed 's/\n//g')" "$NEXUS_URL/service/rest/v1/system/eula"

I receive the following response from the server:

[ {
  "id" : "disclaimer",
  "message" : "Invalid UTF-8 start byte 0x91"
} ]

Full verbose trace is:

* Host nexus-camel-k:48081 was resolved.
* IPv6: (none)
* IPv4: 127.0.0.1
*   Trying 127.0.0.1:48081...
* Connected to nexus-camel-k (127.0.0.1) port 48081
* Server auth using Basic with user 'admin'
> POST /service/rest/v1/system/eula HTTP/1.1
> Host: nexus-camel-k:48081
> Authorization: Basic YWRtaW46Y2MwMzhiZWEtZjFhMy00OWUwLTlkNDYtNGU5NGY0YWRlNzNl
> User-Agent: curl/8.7.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 392
>
* upload completely sent off: 392 bytes
< HTTP/1.1 400 Bad Request
< Date: Tue, 11 Feb 2025 08:36:28 GMT
< Server: Nexus/3.77.1-01 (COMMUNITY)
< X-Content-Type-Options: nosniff
< Content-Type: application/json
< X-Siesta-FaultId: e5506fa5-569c-4571-b12a-736924f3e0e0
< Content-Length: 76

The content of the EULA file is:

{
  "accepted" : true,
  "disclaimer" : "Use of Sonatype Nexus Repository - Community Edition is governed by the End User License Agreement at https://links.sonatype.com/products/nxrm/ce-eula. By returning the value from ‘accepted:false’ to ‘accepted:true’, you acknowledge that you have read and agree to the End User License Agreement at https://links.sonatype.com/products/nxrm/ce-eula."
}

Using 'od' I didn't find any 0x91 byte. All my previous requests are working fine.

I also tried the remove the single quotes which I suspect to be the root cause of the issue and I got an http code 500 in return.
Is there any way to have this working or it is an issue with nexus ?
Tx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant