Cannot create a string longer than 0x1fffffe8 characters

See original GitHub issue

This is happening on this method call:

await dockerCompose.pullAll( dockerComposeConfig );

The full error looks like this:

⠧ Downloading sources.Container 3599aeb67a0e501419c5faae3c737c23-mysql-1  Started
✖ Cannot create a string longer than 0x1fffffe8 characters
Error: Cannot create a string longer than 0x1fffffe8 characters
    at Object.slice (node:buffer:621:37)
    at Buffer.toString (node:buffer:812:14)
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:63:23) {
  code: 'ERR_STRING_TOO_LONG'
}

Can’t help with the actual source because this is coming from a 3rd party library that I’m using. Right here:

https://github.com/WordPress/gutenberg/blob/trunk/packages/env/lib/commands/start.js#L115

Help would be appreciated.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Steveb-pcommented, Aug 17, 2022

As far as I know, we are not performing any pre-processing for the service declaration file (configuration). We pass the file name as-is as a parameter to the docker-compose binary - unless the config is provided as a string (using configAsString option).

So more likely culprit would be the output of a container. I’ll need to check what we can do to store it in a different manner.

1reaction
dugajeancommented, Apr 6, 2022

@AlexZeitler This is happening on my machine. I have 8 GB of RAM. This never happened on my other machine though, so it could be resources related. But then again, I think it should work on every machie.

@Steveb-p Like I mentioned above, this is coming from wp-env, but I’m on a slightly weaker laptop at this time, which is probably what’s causing it. My specs look like this:

Screen Shot 2022-04-06 at 11 07 17 AM

The exact line of code throwing is in wp-env: https://github.com/WordPress/gutenberg/blob/trunk/packages/env/lib/commands/start.js#L115

I believe that simply buffering would solve this issue rather than trying to read a gigantic string at once. Like you said. That’s the most common suggestion for this error around the internet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot create a string longer than 0x1fffffe8 characters
In any case, you're going to have to process that JSON in chunks. Below are different ways to do this. A: Use a...
Read more >
CLI: Cannot create a string longer than 0x1fffffe8 characters
Issue description We have front-end heavy application with ~40 entry points and i want to optimize build size $ rm -rf .
Read more >
Cannot create a string longer than - Edge Impulse Forum
Error while loading features: Model could not be read: Cannot create a string longer than 0x1fffffe8 characters.
Read more >
Upload file : Cannot create a string longer than 0x1fffffe8 ...
Hi We' trying to upload a 430 Meg file and get the error : > Cannot create a string longer than 0x1fffffe8 characters....
Read more >
ERROR: Cannot create a string longer than 0x3fffffe7 characters
I am using the FTP download node and I have a zip file I am trying to download and I get the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found