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

runtime error: index out of range #51

Closed
Daniel-ltw opened this issue May 9, 2017 · 5 comments
Closed

runtime error: index out of range #51

Daniel-ltw opened this issue May 9, 2017 · 5 comments

Comments

@Daniel-ltw
Copy link

panic: runtime error: index out of range

goroutine 20 [running]:
panic(0x2d5820, 0xc4200121c0)
	/home/travis/.gimme/versions/go1.7.linux.amd64/src/runtime/panic.go:500 +0x1a1
github.com/quii/mockingjay-server/vendor/github.com/quii/jsonequaliser.getJSONNodeFromString(0xc420013ee0, 0x2, 0xc4200ce900, 0x2, 0x8)
	/home/travis/gopath/src/github.com/quii/mockingjay-server/vendor/github.com/quii/jsonequaliser/json.go:14 +0x216
github.com/quii/mockingjay-server/vendor/github.com/quii/jsonequaliser.IsCompatible(0xc420013ee0, 0x2, 0xc4200ce7e8, 0x2, 0x0, 0xc42002c400, 0xc42000f7c0)
	/home/travis/gopath/src/github.com/quii/mockingjay-server/vendor/github.com/quii/jsonequaliser/compatability.go:13 +0x39
github.com/quii/mockingjay-server/mockingjay.checkBody(0xc4200ce7e8, 0x2, 0xc420013ee0, 0x2, 0xc4200ce7e8, 0x2, 0x0)
	/home/travis/gopath/src/github.com/quii/mockingjay-server/mockingjay/compatibility.go:147 +0xca
github.com/quii/mockingjay-server/mockingjay.(*CompatibilityChecker).check(0xc4200c2aa0, 0xc420486f18, 0x7fff5fbff712, 0x22, 0x0, 0x0, 0x0)
	/home/travis/gopath/src/github.com/quii/mockingjay-server/mockingjay/compatibility.go:114 +0x4b2
github.com/quii/mockingjay-server/mockingjay.(*CompatibilityChecker).compatabilityWorker(0xc4200c2aa0, 0xc420774720, 0x1e, 0x0, 0xc42000b2f0, 0x28, 0x0, 0xc420013ea8, 0x3, 0x0, ...)
	/home/travis/gopath/src/github.com/quii/mockingjay-server/mockingjay/compatibility.go:70 +0x72
created by github.com/quii/mockingjay-server/mockingjay.(*CompatibilityChecker).CheckCompatibility
	/home/travis/gopath/src/github.com/quii/mockingjay-server/mockingjay/compatibility.go:56 +0x2c0
@quii
Copy link
Owner

quii commented May 9, 2017

Could you supply some more context?

So you have the config?

How do you produce that error?

@Daniel-ltw
Copy link
Author

2.0M 10 May 09:14 example.yaml
./mockingjay-server -config=example.yaml -realURL=http://***.***.***:****

Not sure what the reason could be.

I have a config file of about 2 Mb and ran mockingjay to validate the endpoints.

Could be something to do with control characters in the yaml as well.
[yaml: control characters are not allowed]

Guess it might need a way to handle huge error gracefully?
The json response has a control character that the parser could not handle?

@quii
Copy link
Owner

quii commented May 10, 2017

Thanks for raising this, I will try and find time to look into it.

It would be great if you could give me an example of the YAML coming back from the real server so I can try and reproduce it locally :)

@quii
Copy link
Owner

quii commented May 15, 2017

Hi @Daniel-ltw sorry for the late reply

I have just pushed a change to improve JSON handling which @gypsydave5 kindly wrote

Could you try again with the newest release? https://github.com/quii/mockingjay-server/releases/tag/1.10.4

@Daniel-ltw
Copy link
Author

Looks better.

The error message do make better sense now.

Cheers.

@quii quii closed this as completed May 16, 2017
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

2 participants