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

Mount error #6

Open
rp-happiestbaby opened this issue Nov 5, 2018 · 6 comments
Open

Mount error #6

rp-happiestbaby opened this issue Nov 5, 2018 · 6 comments

Comments

@rp-happiestbaby
Copy link

Hi,
I'm running mongo 3.4
I have gridfs exists in mongo and i want to mount and get all files

So I tried to mount files and i get error

Please help to solve error

gridfs_fuse --mongodb-uri="mongodb://127.0.0.1:27017"  --database="CDN" --mount-point="/mnt/gridfs_fuse"
Traceback (most recent call last):
  File "/usr/local/bin/gridfs_fuse", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/main.py", line 265, in main
    init(args, configure=configure_parser, validate=validate_options)  # defaults
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/main.py", line 252, in init
    ops = operations_factory(options)
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/operations.py", line 507, in operations_factory
    ops = Operations(client[options.database], collection=options.collection, logfile=options.logfile)
  File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1154, in __getitem__
    return self.__getattr__(name)
  File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 1143, in __getattr__
    return database.Database(self, name)
  File "/usr/lib/python2.7/dist-packages/pymongo/database.py", line 71, in __init__
    "of %s" % (basestring.__name__,))
TypeError: name must be an instance of basestring

gridfs_fuse --mongodb-uri="mongodb://127.0.0.1:27017/CDN.fs?replicaSet=CDN5" --database="CDN" --mount-point="/mnt/gridfs_fuse"
root@ny-cdn5-1:~# Traceback (most recent call last):
  File "/usr/local/bin/gridfs_fuse", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/main.py", line 265, in main
    init(args, configure=configure_parser, validate=validate_options)  # defaults
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/main.py", line 252, in init
    ops = operations_factory(options)
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/operations.py", line 507, in operations_factory
    ops = Operations(client[options.database], collection=options.collection, logfile=options.logfile)
  File "/usr/local/lib/python2.7/dist-packages/gridfs_fuse/operations.py", line 60, in __init__
    self.gridfs = gridfs.GridFS(database, collection)
  File "/usr/lib/python2.7/dist-packages/gridfs/__init__.py", line 61, in __init__
    unique=True)
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 958, in ensure_index
    return self.create_index(key_or_list, cache_for, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 863, in create_index
    **self._get_wc_override())
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 362, in insert
    self.database.connection)
  File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 969, in _send_message
    rv = self.__check_response_to_last_error(response)
  File "/usr/lib/python2.7/dist-packages/pymongo/mongo_client.py", line 911, in __check_response_to_last_error
    raise OperationFailure(details["err"], details["code"])
pymongo.errors.OperationFailure: Index with name: files_id_1_n_1 already exists with different options
@gbayarri
Copy link

Did you fix that? I have the same error.

Thanks!

@stephan-hof
Copy link
Member

What versions are used when installing gridfs_fuse ? For example I have it successfully running with.

root@3e03134c9781:/# python2 --version
Python 2.7.16

/venv/bin/pip freeze
....
llfuse==0.40
pymongo==3.11.3

@gbayarri
Copy link

gbayarri commented Apr 22, 2021

Hi, @stephan-hof

$ python2 --version
Python 2.7.18

pymongo==3.11.3

I had a new version of llfuse. After uninstalling it, I'm not able to install the 0.40 one:

$ pip install llfuse==0.40
Defaulting to user installation because normal site-packages is not writeable
Collecting llfuse==0.40
  Using cached llfuse-0.40.tar.bz2 (454 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-lpplG7/llfuse/setup.py'"'"'; __file__='"'"'/tmp/pip-install-lpplG7/llfuse/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-oY6DLN
         cwd: /tmp/pip-install-lpplG7/llfuse/
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-lpplG7/llfuse/setup.py", line 242, in <module>
        main()
      File "/tmp/pip-install-lpplG7/llfuse/setup.py", line 48, in main
        compile_args = pkg_config('fuse', cflags=True, ldflags=False, min_ver='2.8.0')
      File "/tmp/pip-install-lpplG7/llfuse/setup.py", line 133, in pkg_config
        if subprocess.call(cmd) != 0:
      File "/usr/lib/python2.7/subprocess.py", line 172, in call
        return Popen(*popenargs, **kwargs).wait()
      File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
        errread, errwrite)
      File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
        raise child_exception
    OSError: [Errno 2] No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@stephan-hof
Copy link
Member

stephan-hof commented Apr 22, 2021

I had to install the following debian packages to make it work.

apt-get install libfuse-dev pkg-config python-pkgconfig build-essential python-dev libattr1-dev

After that the install was successful

./venv/bin/pip install llfuse==0.40

@gbayarri
Copy link

Ok, now I have downgraded to 0.40 but I have the same error of the first post:

$ gridfs_fuse --mongodb-uri="mongodb://user:password@server" --database="db" --mount-point="path/to/mount"
$ Traceback (most recent call last):
  File "/usr/local/bin/gridfs_fuse", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python2.7/site-packages/gridfs_fuse/main.py", line 265, in main
    init(args, configure=configure_parser, validate=validate_options)  # defaults
  File "/home/user/.local/lib/python2.7/site-packages/gridfs_fuse/main.py", line 252, in init
    ops = operations_factory(options)
  File "/home/user/.local/lib/python2.7/site-packages/gridfs_fuse/operations.py", line 507, in operations_factory
    ops = Operations(client[options.database], collection=options.collection, logfile=options.logfile)
  File "/home/user/.local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 1569, in __getitem__
    return database.Database(self, name)
  File "/home/user/.local/lib/python2.7/site-packages/pymongo/database.py", line 108, in __init__
    "of %s" % (string_type.__name__,))
TypeError: name must be an instance of basestring
$ pip list
Package     Version
----------- ----------
gridfs-fuse 0.1.2.dev1
llfuse      0.40
pip         20.3.4
pymongo     3.11.3
setuptools  44.1.1
wheel       0.36.2

I've found, in the help of your pypi, this instruction:

sudo apt-get install libfuse python-llfuse

But nowadays (Ubuntu 20.04), these two libraries have changed, and the above instruction returns error:

$ sudo apt-get install libfuse python-llfuse
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libfuse
E: Unable to locate package python-llfuse

Now I'm only able to install:

  • libfuse-dev
  • python3-llfuse

Probably the problem is that python3?

Thanks for your help.

@stephan-hof
Copy link
Member

This is how I get it successfully running.

docker run --privileged --rm -ti debian:buster bash

# Inside the container
apt-get update
apt-get install libfuse-dev pkg-config python-pkgconfig build-essential python-dev libattr1-dev python-pip git

pip install llfuse==0.40
pip install git+https://github.com/axiros/py_gridfs_fuse.git

# mongodb running on port 27017
gridfs_fuse --mongodb-uri="mongodb://localhost:27017" --database="db" --mount-point="/srv"

And now files created in /srv are visible inside mongodb.

Probably the problem is that python3?

Unfortunately as far as I know ax_gridfs_fuse has no support for python3

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

3 participants