-
Notifications
You must be signed in to change notification settings - Fork 239
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
[BUG] user-ca-bundle.json: json: offset 1425: invalid character '\r' in string literal #3785
Comments
Would it be possible to log in to the VM and share the content of |
Is it possible to submit the file in a private Red Hat Support Ticket? |
This code crc/pkg/crc/cluster/cluster.go Lines 388 to 391 in 97705a0
\r\n with \n , but according to the error message there are some \r left after doing this.
Could you check your cert file for occurrences of |
@cfergeau according to the comment it Replace the carriage return (" To what I understand, this matches 'once' all the options:
So what if the file contained multiple matches of a newline? |
The code uses |
I managed to work around the issue by removing line 23 (the last empty line). |
What does the file looks like after removing this 'empty' line? and/or on line 22 disappears? I tried to reproduce with data similar to yours ( |
Did you mean
there? |
I found out the issue and able to reproduce it, looks like our package main
import (
"fmt"
"strings"
)
func parseProxyCAData() (string, error) {
rawData := "-----BEGIN CERTIFICATE-----\r\nMIID6zCCAtOgAwIB\r\nKMGinNDOEwKTFXf\r\n-----END CERTIFICATE-----\r\n\r\n"
return trimTrailingEOL(rawData), nil
}
func trimTrailingEOL(s string) string {
fmt.Printf("s: %#v", s)
s1 := strings.TrimRight(s, "\n")
fmt.Println()
fmt.Printf("s1: %#v", s1)
return s1
}
func main() {
_, err := parseProxyCAData()
if err != nil {
fmt.Printf("error: %v", err)
}
} Output
|
It will fix the proxy parse issue in case user update the cert on windows and add blank line at the end of certificate. Unit test is also added for same. fixes: crc-org#3785
It will fix the proxy parse issue in case user update the cert on windows and add blank line at the end of certificate. Unit test is also added for same. When the cert file ends with \r\n, trimTrailingEOL would only remove \n and the file will end with \r. Then this causes issues in regexp which only replace `\r\n` => `\n` but doesn't perform any action for `\r` and eventualy turn up this bug. fixes: crc-org#3785
It will fix the proxy parse issue in case user update the cert on windows and add blank line at the end of certificate. Unit test is also added for same. When the cert file ends with \r\n, trimTrailingEOL would only remove \n and the file will end with \r. Then this causes issues in regexp which only replace `\r\n` => `\n` but doesn't perform any action for `\r` and eventualy turn up this bug. fixes: #3785
General information
crc setup
before starting it? YesCRC version
CRC status
CRC config
Host Operating System
Steps to reproduce
Expected
crc start
completes without errors.Actual
Similar bugreport from the past: #1957
Logs
https://gist.github.com/maxmoser1/903373202dda41558a6b9a9eb6be11cc
Before gather the logs try following if that fix your issue
Tried, but did not help.
The text was updated successfully, but these errors were encountered: