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

Fix error where usageParams were being set incorrectly #34

Closed

Conversation

AndrewBresee
Copy link

Observed:
When running contentful-export against a space with a larger than max size, the 400 error "Response size too big, was: x. Maximum allowed response size: 7340032b." is thrown. This happens even when maxAllowedLimit is set in options.

Reason:
This happens because runContentfulExport does not handle usageParams correctly. Inside of the runContentfulExport function, let {opts, errorLogFile} = usageParams is set. ES6 interprets this to mean opts = usageParams.ops and usageParams does not have the property opts on it. usageParams comes in exactly as it is entered into options.

Fix:
let opts = usageParams should be set first. This will fix the issue setting maxAllowedLimit and includeDrafts. However, errorLogFile is still undefined.

Next Steps:
errorLogFile is not used when calling runContentfulExport within contentful-export/bin/contentful-export.

@AndrewBresee AndrewBresee force-pushed the runContentfulExportPatch branch 3 times, most recently from 51a12ec to 25ef378 Compare February 28, 2017 19:17
@AndrewBresee
Copy link
Author

opts.sourceSpace = opts.sourceSpace || usageParams.spaceId;
 opts.sourceManagementToken = opts.sourceManagementToken || usageParams.managementToken;

needed to be added because const clients = createClients(opts) was not handling opts correctly. if (!opts) was always being hit, so createClients was always being passed opts with sourceSpace and sourceManagementToken.

@AndrewBresee
Copy link
Author

AndrewBresee commented Feb 28, 2017

exportToFile = true needs to be handled properly. Will push changes in a moment.

@axe312ger
Copy link
Collaborator

@AndrewBresee I pushed a fix to the readme describing the correct usage, will be in master soon.

Could you fix your issues with the comment of @Khaledgarbaya?

If yes, feel free to close this one. Otherwise lets escalate here :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants