vericast / nbconflux

nbconflux converts Jupyter Notebooks to Atlassian Confluence pages
BSD 3-Clause "New" or "Revised" License
117 stars 33 forks source link

Error 400 Client Error: Bad Request for url: https://.../child/attachment #6

Closed samhendley closed 6 years ago

samhendley commented 6 years ago

When re-publishing a page with a number of attachments it can start to fail with a bad request error about child attachments. This error appears to be caused when there are more than 50 attachments for a page. A workaround is to delete the confluence page or publish to a new name. A single page with more than 50 attachments may run into this problem and prevent even the initial publication.

Traceback (most recent call last):
  File "/opt/maxpoint/envs/analysis-preview-py3/bin/nbconflux", line 6, in <module>
    sys.exit(nbconflux.cli.main())
  File "/var/lib/python3.6/site-packages/nbconflux/cli.py", line 55, in main
    enable_style=not args.exclude_style, enable_mathjax=args.include_mathjax)
  File "/var/lib/python3.6/site-packages/nbconflux/api.py", line 51, in notebook_to_page
    result = exporter.from_filename(notebook_file)
  File "/var/lib/python3.6/site-packages/nbconflux/exporter.py", line 339, in from_filename
    return super(ConfluenceExporter, self).from_filename(filename, *args, **kwargs)
  File "/var/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/var/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/var/lib/python3.6/site-packages/nbconflux/exporter.py", line 314, in from_notebook_node
    self.add_or_update_attachment(filename, data, resources)
  File "/var/lib/python3.6/site-packages/nbconflux/exporter.py", line 268, in add_or_update_attachment
    resp.raise_for_status()
  File "/var/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://confluence/rest/api/content/83985329/child/attachment