-
Notifications
You must be signed in to change notification settings - Fork 310
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
Error: 'utf-8' codec can't decode byte 0x9d in position 681: invalid start byte #164
Comments
Hello @InLineR495, Thanks for reporting this. Would you be able to post a sample response from your logs? It is probably the last "Received" in the network.testing file before RESTler exited. Thanks, Marina |
Sending was last in logs: Generation-1: Rendering Sequence-1
2021-03-18 11:09:59.309: Sending: 'GET /votings/result HTTP/1.1\r\nAccept: application/json\r\nHost: example.com\r\n_OMITTED_AUTH_TOKEN_\r\nContent-Length: 0\r\nUser-Agent: restler/7.2.0\r\n\r\n' Previous response: 2021-03-18 11:09:59.200: Received: 'HTTP/1.1 200 \r\nServer: nginx/1.16.1\r\nDate: Thu, 18 Mar 2021 11:08:28 GMT\r\nContent-Type: application/json;charset=UTF-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nvary: Origin\r\nvary: Access-Control-Request-Method\r\nvary: Access-Control-Request-Headers\r\nx-content-type-options: nosniff\r\nx-xss-protection: 1; mode=block\r\ncache-control: no-cache, no-store, max-age=0, must-revalidate\r\npragma: no-cache\r\nexpires: 0\r\nx-frame-options: DENY\r\nset-cookie: 09d214e18cbdacf6d05920025f665caf=d64266dd1b5f958a3edfaaa2128996e1; path=/; HttpOnly\r\n\r\nc2\r\n{"error":{"code":129,"description":"description here"}}\r\n0\r\n\r\n' |
@InLineR495 The code is located in this branch: If you could run your test with my changes, and share the logs. |
Here from network.testing (ommiting sensitive data): 2021-04-02 09:35:08.961: Failed to decode header data due to 'utf-8' codec can't decode byte 0xd0 in position 1493: invalid continuation byte when decoding b'HTTP/1.1 200 \r\nServer: nginx/X.XX\r\nDate: Fri, 02 Apr 2021 09:35:08 GMT\r\nContent-Type: application/json;charset=UTF-8\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\nvary: Origin\r\nvary: Access-Control-Request-Method\r\nvary: Access-Control-Request-Headers\r\nset-cookie: abf3ed9a58c43deadc2a1b4aca570fda=c4685aad5e98f9969fd39702c736043d; path=/; HttpOnly\r\ncache-control: private\r\n\r\n451\r\n{"data":[{"id":"9c0cf2c3-d53d-4dc9-93b8-1a84807af922","vId":"26d50624-ce16-47d3-8ac1-5736dy895246","eId":"21231100000000","vName":"\xd0\x92\xd0\x92\xd0\x92\xd0\x92\xd0\x92\xd0\x92","name":"\xd0\x92\xd0\x92\xd0\x92\xd0\x92\xd0\x92\xd0\x92 111","lang":0,"mMar":1,"mType":"ON","q":[{"id":"4207a31a-0a61-43c1-9594-2cfb5ee4a39c","num":1,"eId":"21231100000000","sText":"\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98\xd0\x98r\n' I think it is connected some how with cyrillic symbols |
I cannot seem to be able to repro the issue with data you shared
According to Python documentation (https://docs.python.org/3/howto/unicode.html#the-unicode-type), we can attempt to ignore bad character, and proceed with receiving data. Or replace a character that causes a failure. |
It would be great to handle these types of exceptions and continue running Also i had this today: Initializing: Garbage collection every 30 seconds. |
@InLineR495 - I added "ignore" parameter when decoding fails. Can you give that change a try ? https://github.com/microsoft/restler-fuzzer/pull/173/files |
Now, it's working! |
@InLineR495 We will get this merged next week, Stas is currently on vacation. We're going to put it under an option for now, in case this parsing issue could indicate a bug in some cases. |
Starting restler with cmd:
restler test --grammar_file Compile/grammar.py --dictionary_file Compile/dict.json --token_refresh_interval 3500 --token_refresh_command "python3.8 /opt/api/some-service/token-some-service.py" --no_ssl
Some minutes later:
ERROR: Restler engine failed. See logs in /opt/api/admin-service/Test directory for more information.
But EngineStdErr is empty. The information in EngineStdOut:
Initializing: Garbage collection every 30 seconds.
Terminating garbage collection. Waiting for max 300 seconds.
'utf-8' codec can't decode byte 0x9d in position 681: invalid start byte
The information from main.txt:
Rendering request 14 from scratch
2021-03-18 11:09:59.824: Final Swagger spec coverage: 4 / 25
2021-03-18 11:09:59.824: Rendered requests: 0 / 25
2021-03-18 11:09:59.824: Rendered requests with "valid" status codes: 4 / 0
2021-03-18 11:09:59.824: Num fully valid requests (no resource creation failures): 4
2021-03-18 11:09:59.824: Num requests not rendered due to invalid sequence re-renders: 0
2021-03-18 11:09:59.824: Num invalid requests caused by failed resource creations: 0
2021-03-18 11:09:59.824: Total Creations of Dyn Objects: 0
2021-03-18 11:09:59.824: Total Requests Sent: {'gc': 0, 'main_driver': 71}
2021-03-18 11:09:59.824: Bug Buckets: {'main_driver_504': 1}
The text was updated successfully, but these errors were encountered: