danielfrg / s3contents

Jupyter Notebooks in S3 - Jupyter Contents Manager implementation
Apache License 2.0
248 stars 88 forks source link

MalformedACLError Error + No module named 'dask' when starting up notebook with S3ContentsManager #51

Closed jiyer2016 closed 6 years ago

jiyer2016 commented 6 years ago

Get the following error when starting up jupyter notebook:

$ jupyter notebook
Traceback (most recent call last):
  File "c:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python36\Scripts\jupyter-notebook.EXE\__main__.py", line 9, in <module>
  File "c:\program files\python36\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "c:\program files\python36\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "c:\program files\python36\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\program files\python36\lib\site-packages\notebook\notebookapp.py", line 1627, in initialize
    self.init_configurables()
  File "c:\program files\python36\lib\site-packages\notebook\notebookapp.py", line 1322, in init_configurables
    log=self.log,
  File "c:\program files\python36\lib\site-packages\s3contents\s3manager.py", line 45, in __init__
    sse=self.sse)
  File "c:\program files\python36\lib\site-packages\s3contents\s3_fs.py", line 62, in __init__
    self.init()
  File "c:\program files\python36\lib\site-packages\s3contents\s3_fs.py", line 65, in init
    self.mkdir("")
  File "c:\program files\python36\lib\site-packages\s3contents\s3_fs.py", line 145, in mkdir
    self.fs.touch(path_)
  File "c:\program files\python36\lib\site-packages\s3fs\core.py", line 949, in touch
    Bucket=bucket, Key=key, ACL=acl)
  File "c:\program files\python36\lib\site-packages\s3fs\core.py", line 172, in _call_s3
    return method(**additional_kwargs)
  File "c:\program files\python36\lib\site-packages\botocore\client.py", line 317, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\program files\python36\lib\site-packages\botocore\client.py", line 615, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (MalformedACLError) when calling the PutObject operation: The XML you provided was not well-formed or did not validate against our published schema.
No module named 'dask'

Here is how my configuration looks:

from s3contents import S3ContentsManager
c = get_config()
# Tell Jupyter to use S3ContentsManager for all storage.
c.NotebookApp.contents_manager_class = S3ContentsManager
c.S3ContentsManager.access_key_id = "***"
c.S3ContentsManager.secret_access_key = "***"
c.S3ContentsManager.endpoint_url = "***"
c.S3ContentsManager.bucket = "***"
c.S3ContentsManager.prefix = "notebooks/test"

Why would this happen ?

danielfrg commented 6 years ago

You can ignore the No module named 'dask' its coming from one of the dependencies s3fs and it doesn't cause any issues.

The other one is different and I have seen it when using boto independently and its coming from boto. Maybe check the versions you are using?

jiyer2016 commented 6 years ago

Thanks, Would you be able to recommend the correct combinations of s3contents, s3fs and boto3 and botocore versions that are known to work well with each other ??

jiyer2016 commented 6 years ago

Here is the combination of libraries with which the issue happens. Perhaps - someone with a working setup can provide information on how different their setup as compared to the below:

boto3 1.9.23 botocore 1.12.23 ipykernel 4.10.0 ipython 7.0.1 ipython-genutils 0.2.0 ipython-sql 0.3.9 jupyter 1.0.0 jupyter-client 5.2.3 jupyter-console 6.0.0 jupyter-core 4.4.0 jupyterhub 0.9.4 jupyterlab 0.35.1 jupyterlab-server 0.2.0 notebook 5.7.0 s3contents 0.1.11 s3fs 0.1.5 s3transfer 0.1.13 tornado 5.1.1 traitlets 4.3.2

jiyer2016 commented 6 years ago

Can anybody help with this please ??

danielfrg commented 6 years ago

It's weird if it's a dependency since some of those are ==. You can take a look at one of the CI builds to see whats passing for those: https://travis-ci.org/danielfrg/s3contents/jobs/441781489

Try adding this other settings to the ContentsManager: signature_version="s3v4".

jiyer2016 commented 6 years ago

Thanks for the response. The versions of the libraries are pretty much in sync with the travis logs. My setup uses minio s3 storage that supports the version 2 signature (and not v4). I added the following configuration - but get the same error - Thats strange.

c.S3ContentsManager.signature_version = "s3"

Do you see any problems working against a minio storage that supports only the v2 signature version ?

danielfrg commented 6 years ago

That could be the reason. The tests on Travis uses minio and uses s3v4 so imagine libraries only support new versions of the signature. I would recommend upgrading your minio.