joe42 / CloudFusion

Linux file system (FUSE) to access Dropbox, Sugarsync, Amazon S3, Google Storage, Google Drive or WebDAV servers.
http://joe42.github.com/CloudFusion/
288 stars 35 forks source link

Doesn't work for SugarSync #4

Closed Nobutarou closed 10 years ago

Nobutarou commented 10 years ago

When I copy my SugarSync setting file to mnt/config/config, the next error always happens,

$ LANG=C cp Sugarsynctest.ini mnt/config/config cp: writing 'mnt/config/config': Bad address cp: failed to extend 'mnt/config/config': Bad address

I can send my setting file because I've created an account only for this checking.

Regards,

joe42 commented 10 years ago

Hi there Nobutarou,

Thank you for reporting this issue. The error indicates that something in your configuration file is not right. You could post the configuration file you use, replacing your username and password with ***. Furthermore, you can turn on logging, to get more details on the error. First, stop cloudfusion::

fusermount -zu mnt

Now, you can turn on logging with::

python -m cloudfusion.main mnt log

This will create files in .cloudfusion/logs with information on what is going on. You can post these logs, but edit out your usename & password first. Other than a problem in the configuration file, the only explanation I can come up with is that you are not connected to the internet.

Nobutarou commented 10 years ago

Hello, here is my setting file and pyfusebox.log. In the log directory, there is sugarsync.log but its size is 0byte. Could you please cheke them?

[auth]
#fill in your username and password here:
user = m9362429663@*******.***
password = ********

host = api.sugarsync.com
server_url = https://api.sugarsync.com/

# the root of Sugarsync operations: 2 for workspace
root = 2

# key and secret can be obtained by creating a developer account 
access_key_id = TVRJek56WXpOakV6TURRME1URTJPRFEyTURr
private_access_key = TkRNME5EUmtabVU0T1RFeE5EWmlZams1T1RsbVlXVmxZMkk0TTJFelpqTQ==

[store]
name = sugarsync
#How many seconds it may take until a file you just wrote is beginning to be uploaded, always counting from the time 
#you last modified the file.
#During this time you can delete the file again, without ever uploading the file.
#If your files change a lot, and you are in no hurry to upload them, set this to about 10 minutes or more (600).
cache = 60
#How many seconds it may take for you to see changes made to your Sugarsync account by another application.
#During this time you do not need to communicate with the store to see a directory listing, for instance.
#So listing directories is very fast. 
#Set this to 15, if you quickly want to see files uploaded by your mobile computer or handheld, when you refresh the directory.
#If you upload file through CloudFusion only, this can be set to ten minutes (600).
metadata_cache = 120
# Approximate cache size limit im MB
cache_size = 5000
# Identifier for persistent database. Use one id per cloud account to keep the cache after application shutdown.
# Default is a random number:
cache_id = sugarsyncacc1
2013-07-28 21:18:17,009 - pyfusebox - DEBUG - initialized configurable pyfusebox
2013-07-28 21:18:17,009 - pyfusebox - INFO - PyFuseBox initialized
2013-07-28 21:18:20,906 - pyfusebox - DEBUG - getattr /config
2013-07-28 21:18:20,908 - pyfusebox - DEBUG - getattr /config/config
2013-07-28 21:18:20,916 - pyfusebox - DEBUG - open /config/config
2013-07-28 21:18:20,917 - pyfusebox - DEBUG - truncate /config/config to 0
2013-07-28 21:18:20,918 - pyfusebox - DEBUG - getattr /config/config
2013-07-28 21:18:20,919 - pyfusebox - DEBUG - write /config/config ... starting with [auth]
#fi at 0 - fh: 0
2013-07-28 21:18:20,920 - pyfusebox - DEBUG - writing to virtual file /config/config
2013-07-28 21:18:20,920 - pyfusebox - DEBUG - write [auth]
#fill in your username and password here:
user = m9362429663@*******.***
password = ********

host = api.sugarsync.com
server_url = https://api.sugarsync.com/

# the root of Sugarsync operations: 2 for workspace
root = 2

# key and secret can be obtained by creating a developer account 
access_key_id = TVRJek56WXpOakV6TURRME1URTJPRFEyTURr
private_access_key = TkRNME5EUmtabVU0T1RFeE5EWmlZams1T1RsbVlXVmxZMkk0TTJFelpqTQ==

[store]
name = sugarsync
#How many seconds it may take until a file you just wrote is beginning to be uploaded, always counting from the time 
#you last modified the file.
#During this time you can delete the file again, without ever uploading the file.
#If your files change a lot, and you are in no hurry to upload them, set this to about 10 minutes or more (600).
cache = 60
#How many seconds it may take for you to see changes made to your Sugarsync account by another application.
#During this time you do not need to communicate with the store to see a directory listing, for instance.
#So listing directories is very fast. 
#Set this to 15, if you quickly want to see files uploaded by your mobile computer or handheld, when you refresh the directory.
#If you upload file through CloudFusion only, this can be set to ten minutes (600).
metadata_cache = 120
# Approximate cache size limit im MB
cache_size = 5000
# Identifier for persistent database. Use one id per cloud account to keep the cache after application shutdown.
# Default is a random number:
cache_id = sugarsyncacc1

 to 0
2013-07-28 21:18:20,920 - pyfusebox - DEBUG - wrote 1519 bytes starting with [auth]
#fill in your username ...
2013-07-28 21:18:20,920 - pyfusebox - DEBUG - written bytes:1519
2013-07-28 21:18:20,920 - pyfusebox - DEBUG - _initialize_store:
2013-07-28 21:18:20,923 - pyfusebox - DEBUG - got service name
2013-07-28 21:18:20,923 - pyfusebox - DEBUG - got cache parameter
2013-07-28 21:18:20,924 - pyfusebox - DEBUG - got auth data: {'server_url': 'https://api.sugarsync.com/', 'host': 'api.sugarsync.com', 'private_access_key': 'TkRNME5EUmtabVU0T1RFeE5EWmlZams1T1RsbVlXVmxZMkk0TTJFelpqTQ==', 'user': 'm9362429663@*******.***', 'access_key_id': 'TVRJek56WXpOakV6TURRME1URTJPRFEyTURr', 'password': '********', 'root': '2'}
2013-07-28 21:18:20,925 - pyfusebox - DEBUG - __get_new_store:
2013-07-28 21:18:21,181 - pyfusebox - DEBUG - flush /config/config - fh: 0
2013-07-28 21:18:21,182 - pyfusebox - DEBUG - release /config/config - fh: 0
joe42 commented 10 years ago

The configuration file is alright. I tested it with my account. This seems to be a runtime error. Are you online? Is your username and password correct? Stop cloudfusion, and try starting it in foreground mode:

python -m cloudfusion.main mnt foreground log

Open a new terminal and try again. Once you copied your configuration file to mnt/config/config, an error message will be printed in the first terminal. A ServerNotFound Exception indicates that you could not connect to the server, so you might be offline. An ExpatError indicates that your username/password combination is invalid. These errors should be handled more gracefully, so I created an issue to make this more user-friendly: Issue #5

Nobutarou commented 10 years ago

This is the terminal screen.

% python -m cloudfusion.main mnt foreground log
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/fuse.py", line 301, in _wrapper_
    return func(*args, **kwargs) or 0
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/fuse.py", line 372, in write
    return self.operations('write', path, data, offset, fh)
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/fuse.py", line 507, in __call__
    return getattr(self, op)(*args)
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/pyfusebox/configurable_pyfusebox.py", line 173, in write
    self._initialize_store()
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/pyfusebox/configurable_pyfusebox.py", line 141, in _initialize_store
    store = self.__get_new_store(service, auth) #catch error?
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/pyfusebox/configurable_pyfusebox.py", line 156, in __get_new_store
    store = SugarsyncStore(auth)
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/store/sugarsync/sugarsync_store.py", line 113, in __init__
    self.client = SugarsyncClient(config)
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/store/sugarsync/client.py", line 19, in __init__
    self.create_user(self.username, self.password)
  File "/usr/lib/python2.7/site-packages/CloudFusion-1.0.0-py2.7.egg/cloudfusion/store/sugarsync/client.py", line 26, in create_user
    response, content = conn.request("https://provisioning-api.sugarsync.com/users","POST",params,headers)
  File "/usr/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1570, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1317, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1252, in _conn_request
    conn.connect()
  File "/usr/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 1021, in connect
    self.disable_ssl_certificate_validation, self.ca_certs)
  File "/usr/lib/python2.7/site-packages/httplib2-0.8-py2.7.egg/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/usr/lib/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 141, in __init__
    ciphers)
SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
Nobutarou commented 10 years ago

Could you please check the following account? I've only made it for check and will delete after working.

user = m9362429663@deadesu.com password = hogehoge

joe42 commented 10 years ago

The account works fine for me. Tested on a clean Ubuntu 12.04 LiveCD version with the current version of CloudFusion. The error message shows that the ssl certificate validation fails. As suggested here: http://stackoverflow.com/questions/7451859/looking-to-solve-the-ssl-error-in-google-plus-api-command-line-python-starter-ki , you should be able to resolve the problem by changing the line in cloudfusion/dropbox/rest.py from

TRUSTED_CERT_FILE = pkg_resources.resource_filename(__name__, 'trusted-certs.crt')

to

TRUSTED_CERT_FILE =  'trusted-certs.crt'

Then reinstall by changing into cloudfusion repository and executing

sudo python setup.py install

Please tell me the distribution and version you try to install CloudFusion, for me to reproduce the error, and test the above fix. Then I will include the patch in the next release.

Nobutarou commented 10 years ago

Hello Joe,

After googling, I think it comes from httplib2 version. I downgrade from 0.8 to 0.6 and then CloudFusion works. Thank you.

PS. I am using LFS system and use latest CloudFusion by git clone.

Regards,

2013/7/29 joe42 notifications@github.com

The account works fine for me. Tested on a clean Ubuntu 12.04 LiveCD version with the current version of CloudFusion. The error message shows that the ssl certificate validation fails. As suggested here: http://stackoverflow.com/questions/7451859/looking-to-solve-the-ssl-error-in-google-plus-api-command-line-python-starter-ki, you should be able to resolve the problem by changing the line in cloudfusion/dropbox/rest.py from

TRUSTED_CERT_FILE = pkg_resources.resource_filename(name, 'trusted-certs.crt')

to

TRUSTED_CERT_FILE = 'trusted-certs.crt'

Then reinstall by changing into cloudfusion repository and executing

sudo python setup.py install

Please tell me the distribution and version you try to install CloudFusion, for me to reproduce the error, and test the above fix. Then I will include the patch in the next release.

— Reply to this email directly or view it on GitHubhttps://github.com/joe42/CloudFusion/issues/4#issuecomment-21685924 .