Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

"object is too large and will be parsed partially" error #1037

Closed
omasseau opened this issue Sep 18, 2023 · 4 comments
Closed

"object is too large and will be parsed partially" error #1037

omasseau opened this issue Sep 18, 2023 · 4 comments
Labels
bug Something isn't working user request Requested by the community

Comments

@omasseau
Copy link

omasseau commented Sep 18, 2023

Brief summary

I cannot perform k6 browser tests for my webpage as I get these warnings that seems to prevent the javascript contained in my page to parse the json responses of ajax requests.

I get many "object is too large and will be parsed partially" errors. The page is working perfectly fine in Chrome.

WARN[0004] "[Redux-LocalStorage-Simple]" "Invalid load 'bd_portal::persistence' provided. Check your 'states' in 'load()'. If this is your first time running this app you may see this message. To disable it in future use the 'disableWarnings' flag, see documentation."  browser_source=console-api source=browser
WARN[0004] "No Mixpanel key has been passed"             browser_source=console-api source=browser
WARN[0005] "Unable to find Mixpanel instance."           browser_source=console-api source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"datasources\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"locationService\": invalid character ' ' in literal true (expecting 'r')" source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"locationConfig\": invalid character ' ' in literal true (expecting 'r')" source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"_disposables\": invalid character 'A' looking for beginning of value" source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"entities\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"categories\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"categories\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"categories\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"categories\": invalid character 'A' looking for beginning of value" source=browser
WARN[0008] object is too large and will be parsed partially  browser_source=console-api source=browser
ERRO[0008]                                               browser_source=console-api error="parsing object property \"categories\": invalid character 'A' looking for beginning of value" source=browser

image

xk6-browser version

v1.0.2 (bundled in k6 v0.46.0)

OS

Windows

Chrome version

116.0.5845.188

Docker version and image (if applicable)

No response

Steps to reproduce the problem

import { browser } from 'k6/experimental/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
}

export default async function () {

  const page = browser.newPage();
  try {
    await page.goto('https://mypage', { waitUntil: 'networkidle' });

    page.locator('input[name="username"]').type('*****');
    page.locator('input[name="password"]').type('****');
    
    const submitButton = page.locator('button[name="login"]');

    await Promise.all([
        page.waitForNavigation(),
        submitButton.click(),
      ]);

    page.waitForSelector('//span[text()="File upload"]');
    
    page.screenshot({ path: 'screenshot.png' });
  } finally {
    page.close();
  }
}

Expected behaviour

No errors parsing the returned json.

Actual behaviour

Error reading json responses

@omasseau omasseau added the bug Something isn't working label Sep 18, 2023
@ahlstro
Copy link

ahlstro commented Sep 26, 2023

Have the exact same problem

@inancgumus inancgumus added user request Requested by the community next Might be eligible for the next planning (not guaranteed!) labels Sep 26, 2023
@ankur22
Copy link
Collaborator

ankur22 commented Oct 3, 2023

@omasseau could you open a new thread in the community forum?

The warning object is too large and will be parsed partially occurs when an object on your website is logged and this log message is passed back to k6, at which point it will try to parse the object and print it out in the terminal window from where k6 is running from. k6 isn't going to get in the way of parsing of a response from an async request that your website is making.

It looks like there are errors with parsing an object on your website: "parsing object property \"datasources\": invalid character 'A' looking for beginning of value".

Apart from these logs, what else occurs that fails the test? Could you paste the whole content of the output?

@inancgumus inancgumus removed the next Might be eligible for the next planning (not guaranteed!) label Oct 19, 2023
@ankur22
Copy link
Collaborator

ankur22 commented Jan 11, 2024

We've downgraded this warning to an info since we believe that this might have been causing some confusion. This change is already in the latest version of k6 (v0.48.0).

@ankur22
Copy link
Collaborator

ankur22 commented Dec 16, 2024

We've downgraded this further to a debug since it's not useful to see in the logs (#1553).

I'm closing this issue as I don't believe there much else we can do here. The initial issues arises from chrome not being able to send the whole JS object to the browser module, and that is why we log something.

@ankur22 ankur22 closed this as completed Dec 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working user request Requested by the community
Projects
None yet
Development

No branches or pull requests

4 participants