Closed githubuser100007 closed 2 years ago
Thank you for providing the example and the details. I have used the same example and unable to see the issue mentioned. I am seeing well-formatted logs.
Though I had few questions about this.
Based on what I observe is the issue lies in the postData received from the website.
What I have observed, is that the postData field has a value of a string followed by postDataEntries. Example:
"postData" : "{\"batch\":[{\"context\":{\"page\":{\"path\":\"/us/en/townsquare/why-plastic-straws-are-being-banned\",\"referrer\":\"\",\"search\":\"\",\"title\":\"Why Plastic Straws Are Being Banned\",\"url\":\"https://squareup.com/us/en/townsquare/why-plastic-straws-are-being-banned\"},\"subject\":{\"anonymousToken\":\"9fd8800c-21dc-49a3-8ac2-a5b1dfc563e8\"},\"browser\":{\"name\":\"Chrome Headless\",\"version\":\"90.0.4430.212\",\"height\":1200,\"width\":1920},\"campaign\":{},\"locale\":{\"countryCode\":\"US\",\"language\":\"en-US\"},\"os\":{\"name\":\"Mac OS\",\"version\":\"10.13.6\"},\"referrer\":{\"referrer\":\"\"},\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/90.0.4430.212 Safari/537.36\",\"library\":{\"name\":\"data-api.js\",\"version\":\"5.2.0\"}},\"integrations\":{},\"properties\":{\"window_width\":1920,\"window_height\":1200,\"device_pixel_ratio\":1,\"network_time\":3261,\"rendering_time\":1261,\"time_to_dom_ready\":4522,\"entry_id\":\"7BaFsE02iMnBsWzmkQSNNn\",\"path\":\"/us/en/townsquare/why-plastic-straws-are-being-banned\",\"referrer\":\"\",\"search\":\"\",\"title\":\"Why Plastic Straws Are Being Banned\",\"url\":\"https://squareup.com/us/en/townsquare/why-plastic-straws-are-being-banned\"},\"category\":null,\"name\":null,\"anonymousId\":\"9fd8800c-21dc-49a3-8ac2-a5b1dfc563e8\",\"entityType\":\"anonymous_visitor\",\"entityId\":null,\"timestamp\":\"2021-05-13T11:56:54.556Z\",\"type\":\"page\",\"apiMethod\":\"page\",\"apiKey\":\"41ec1b68-21b1-4687-853a-f968e54134db\",\"sentAt\":\"2021-05-13T11:56:54.557Z\"}]}"
However, that is not followed in the log the error occurred in.
OS: MacOS Browser: Chrome Browser version: Version 90.0.4430.24 (Official Build) (64-bit) Browser Driver version: ChromeDriver 90.0.4430.24 Language Bindings Version: Beta 2
Issue seems intermittent. It appears during large scale parallel testing.
One error that just happened today was when crawling: https://bookiesbonuses.com/visit/888sport-finland
Should I just treat this as a timeout exception?
Thank you for your response. Did you face the same error while crawling the website mentioned? or was it a timeout exception? Please provide a reproducible code/script for recreating the error in the parallel setting.
Did you get a TimeoutException while starting the driver when running tests in parallel? I tried to recreate the issue by running a TestNG suite in parallel. I saw a bunch of TimeoutExceptions with the stack trace:
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:252)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:82)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:99)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:86)
at com.company.TestClassParallelLogs.waitTest2(TestClassParallelLogs.java:126)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:598)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:824)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:224)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:86)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620)
... 21 more
Caused by: java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1886)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2021)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:214)
If yes, then https://github.com/SeleniumHQ/selenium/commit/49f706f436b7c97d5ac39596d141d345aef58b79 fixes it. However, I still was unable to see the Unterminated String Error: driver.manage().logs().get(LogType.PERFORMANCE)
.
Closing as we have not had a reply from the user. If this is still an issue please raise and issue again with all the details we would need to recreate.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
🐛 Bug Report
Getting a JsonException: Unterminated string when attempting to retrieve the performance logs via
To Reproduce
Expected behavior
Should not present error
Test script or set of commands reproducing this issue
Error Produced
Environment
OS: AWS Linux 2 Browser: Chrome Browser version: Version 89.0.4389.90 (Official Build) (64-bit) Browser Driver version: ChromeDriver 89.0.4389.23 Language Bindings version: Java 8 Selenium Grid version (if applicable): Beta 2