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

Share link that used to work now doesn't with an error "entity too large" #174

Open
alexgleith opened this issue Jan 14, 2025 · 3 comments

Comments

@alexgleith
Copy link

Error captured below.

Share URL is this: https://maps.digitalearthpacific.org/#share=s-se4QkfmUsarYesLIzoXr

PayloadTooLargeError: request entity too large
at readStream (/app/node_modules/raw-body/index.js:163:17)
at getRawBody (/app/node_modules/raw-body/index.js:116:12)
at read (/app/node_modules/body-parser/lib/read.js:79:3)
at textParser (/app/node_modules/body-parser/lib/types/text.js:86:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)
at /app/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
at next (/app/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/app/node_modules/express/lib/router/index.js:175:3)
at router (/app/node_modules/express/lib/router/index.js:47:12)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)
at /app/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
at next (/app/node_modules/express/lib/router/index.js:280:10)
at serveStatic (/app/node_modules/serve-static/index.js:75:16)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)
at /app/node_modules/express/lib/router/index.js:286:9
at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
at next (/app/node_modules/express/lib/router/index.js:280:10) {
expected: 256213,
length: 256213,
limit: 204800,
type: 'entity.too.large'
}
@nf-s
Copy link
Contributor

nf-s commented Jan 14, 2025

You can increase the size using this config option, the default is 200kB

shareMaxRequestSize: "200kb",

Every time you click the "share button", if changes have been made to the map, then a new share link is generated on top of the existing share link. This sometimes leads to very large share links, if you keep creating new links on top of each other.

A share link basically contains all user generated changes to TerriaJS state, this can become very large, especially if you are adding 100s (or 1000s) of datasets to the workbench. To compound this, if you are using the story feature, each story scene is basically a new share link.

We don't have an easy way to clean up large share links, you can manually do it by inspecting network requests and posting cleaned share JSON back to TerriaJS server (at the /share endpoint)

@nf-s
Copy link
Contributor

nf-s commented Jan 14, 2025

The share link you provided doesn't seem to have data in it. If you were getting PayloadTooLargeError, then the share link will fail to send. If you still have that browser window active, can you please provide the JSON payload from the failed POST request? Then I can take a look to see what is making it so large

@nf-s
Copy link
Contributor

nf-s commented Jan 15, 2025

I think the main issue here, is that TerriaJS-server seems to still return a shareKey, even if the share JSON isn't saved to S3 due to the PayloadTooLargeError. TBC

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