xybu / onedrive-d-old

Microsoft OneDrive client on Linux.
http://xybu.me/projects/onedrive-d/
GNU Lesser General Public License v3.0
820 stars 143 forks source link

How to fulfil step "4" (Pre-requisites) without Python 3? #139

Closed ghost closed 9 years ago

ghost commented 9 years ago

A lot of other apps are running on Python 2.7.6 hence I do not want to risk breaking anything (I am not well versed with the system).

Is there a way to run this app on my current Python version?

Also how to go about fulfilling step 3 requisites?

vk5ztv commented 9 years ago

Python3 can coexist with python 2.7.6. It is important though to make sure you're running the correct version of python programs e.g. using pip to install modules under 2.7 or 3.x. On my system I have pip-2.7 and pip-3.3. I think 3.3 is the default, so if I want to install a python 2.7 module I run pip-2.7 instead of just pip. The same applies to other python scripts.

ghost commented 9 years ago

I have it working now. But it's not syncing anything after some initial sync.

When I ran onedrive-d start (or onedrive-d status) I found this error:

qxlab@server:~$ onedrive-d status
Loading configuration ... OK
Traceback (most recent call last):
  File "/usr/local/bin/onedrive-d", line 9, in <module>
    load_entry_point('onedrive-d==1.1.0dev', 'console_scripts', 'onedrive-d')()
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 451, in main
    raise RuntimeError('Click will abort further execution '
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.

I visited the link and did

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

and it worked. But when I logged in again I notice it wasn't running and nothing was syncing. I tried onedrive-d start and I get the same ASCII error again.

Now I can do the changes again and hope it runs but I am not sure how many times I will keep checking it.

Also, runnin ps -ef | grep onedrive-d gives:

qxlab     17605     1  2 04:03 ?        00:04:02 /usr/bin/python3 /usr/local/bin/onedrive-d start
qxlab     28361 27809  0 07:14 pts/1    00:00:00 grep --color=auto onedrive-d

(I had changed the numerical values to too high as it said would slow down the upload/sync - 1.5GB and 50MB respectively). I will set it back to default again.

So what do I do?

Log: https://gist.github.com/qxlab/01d80dc48e00c33d910d

xybu commented 9 years ago

To permanently change system locale, see "Setup System Locale" section of http://xybu.me/setting-up-a-ubuntu-server/

ghost commented 9 years ago

I did that but why am I getting this now:

qxlab@server:~$ onedrive-d status
Loading configuration ... OK
onedrive-d -- pid: 17605, status: sleeping, uptime: 4h 53m, %cpu: 0.0, %mem: 0.8
qxlab@server:~$ 

While pretty much nothing (except maybe) has synced out of 70GB I need to and it's already sleeping as it says.

My config:

{"BITS_BLOCK_SIZE": 524288, "BITS_FILE_MIN_SIZE": 5242880, "LAST_RUN_TIMESTAMP": "1970-01-01T00:00:00+0000", "ONEDRIVE_TOKENS_EXP": "2015-03-15T03:54:43+0000", "NUM_OF_WORKERS": 4, "DEEP_SCAN_INTERVAL": 60, "ONEDRIVE_TOKENS": {, "refresh_token", "user_id": "", "expires_in": 3600, "scope": "wl.skydrive wl.skydrive_update wl.offline_access", "token_type": "bearer"}, "LOG_FILE_PATH": "/var/log/onedrive_d.log", "MIN_LOG_LEVEL": 10, "USE_GUI": false, "ONEDRIVE_ROOT_PATH": "/home/qxlab/KEEP", "NETWORK_ERROR_RETRY_INTERVAL": 5}

I see that token expires thing. Is that the problem? But I didn't change anything regarding that.

xybu commented 9 years ago

If you check your Task Manager or system monitor or equivalent program, you may virtually see all processes "sleeping". At least that happened to my Xubuntu and Ubuntu MATE hosts...

No worry about the "expires_in" and such. They are time intervals and timestamps. If the token is wrong then program won't start.

ghost commented 9 years ago

So I do this and I am back to square 1 :(

qxlab@server:~$ onedrive-d status
Loading configuration ... OK
Traceback (most recent call last):
  File "/usr/local/bin/onedrive-d", line 9, in <module>
    load_entry_point('onedrive-d==1.1.0dev', 'console_scripts', 'onedrive-d')()
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 451, in main
    raise RuntimeError('Click will abort further execution '
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.

I mean after the last time I did onedrive-d start successfully and getting this has proof that it was running:

qxlab@server:~$ onedrive-d start
Loading configuration ... OK
WARNING: onedrive-d already running with PID 17605

Needless it hasn't synced anything after that.

However I still get this:

qxlab@server:~$ ps -ef | grep onedrive-d
qxlab     12473 12190  0 12:19 pts/1    00:00:00 grep --color=auto onedrive-d
qxlab     17605     1  0 04:03 ?        00:04:12 /usr/bin/python3 /usr/local/bin/onedrive-d start

Problem is, it's not working even if it maybe running (Though top didn't show it).

xybu commented 9 years ago

Use debug mode to see what happens before you use daemon mode. The argument is on readme.

Sincerely, Xiangyu Bu

Sent from my Windows Phone


From: QxLabmailto:notifications@github.com Sent: ‎3/‎15/‎2015 7:21 AM To: xybu/onedrive-dmailto:onedrive-d@noreply.github.com Cc: Xiangyu Bumailto:xybu92@live.com Subject: Re: [onedrive-d] How to fulfil step "4" (Pre-requisites) without Python 3? (#139)

So I do this and I am back to square 1 :(

qxlab@server:~$ onedrive-d status
Loading configuration ... OK
Traceback (most recent call last):
  File "/usr/local/bin/onedrive-d", line 9, in <module>
    load_entry_point('onedrive-d==1.1.0dev', 'console_scripts', 'onedrive-d')()
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 488, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click-2.5-py3.4.egg/click/core.py", line 451, in main
    raise RuntimeError('Click will abort further execution '
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.

I mean after the last time I did onedrive-d start successfully and getting this has proof that it was running:

qxlab@server:~$ onedrive-d start
Loading configuration ... OK
WARNING: onedrive-d already running with PID 17605

Needless it hasn't synced anything after that.

However I still get this:

qxlab@server:~$ ps -ef | grep onedrive-d
qxlab     12473 12190  0 12:19 pts/1    00:00:00 grep --color=auto onedrive-d
qxlab     17605     1  0 04:03 ?        00:04:12 /usr/bin/python3 /usr/local/bin/onedrive-d start

Problem is, it's not working even if it maybe running (Though top didn't show it).


Reply to this email directly or view it on GitHub: https://github.com/xybu/onedrive-d/issues/139#issuecomment-80964911

ghost commented 9 years ago

To permanently change system locale, see "Setup System Locale" section of http://xybu.me/setting-up-a-ubuntu-server/ So this didn't work. Even now every time I have to issue an onedrive-d .... command I have to go and follow instruction given on http://click.pocoo.org/python3.

Anyway, I did that and now I am running it in a screen with --debug option.

added task "sy" "/home/qxlab/KEEP".
uploading block 314572800 - 315097087 (total: 1462276096 B)

These of lines keep coming in output constantly. So I guess now some upload is going on, don't know how big or small because I can't see any files in the livedrive dashboard online except some .srt files that were too tiny so I guess they must have completed. Now my assumption is that all the files, the bigger ones (several hundred MBs and some more than 1GB), are being uploaded (maybe more than one such big file is being uploaded in parallel) and hence none of them are completing so I can't see anything online.

Or maybe it's just not working. Anyway, it's 70GB total and if it takes more than 2-3 days from my 100Mbps server, I will just give up.

xybu commented 9 years ago

You can add large files to ignore list so they won't get downloaded or uploaded.

Sincerely, Xiangyu Bu

Sent from my Windows Phone


From: QxLabmailto:notifications@github.com Sent: ‎3/‎15/‎2015 11:34 AM To: xybu/onedrive-dmailto:onedrive-d@noreply.github.com Cc: Xiangyu Bumailto:xybu92@live.com Subject: Re: [onedrive-d] How to fulfil step "4" (Pre-requisites) without Python 3? (#139)

To permanently change system locale, see "Setup System Locale" section of http://xybu.me/setting-up-a-ubuntu-server/ So this didn't work. Even now every time I have to issue an onedrive-d .... command I have to go and follow instruction given on http://click.pocoo.org/python3.

Anyway, I did that and now I am running it in a screen with --debug option.

added task "sy" "/home/qxlab/KEEP".
uploading block 314572800 - 315097087 (total: 1462276096 B)

These of lines keep coming in output constantly. So I guess now some upload is going on, don't know how big or small because I can't see any files in the livedrive dashboard online except some .srt files that were too tiny so I guess they must have completed. Now my assumption is that all the files, the bigger ones (several hundred MBs and some more than 1GB), are being uploaded (maybe more than one such big file is being uploaded in parallel) and hence none of them are completing so I can't see anything online.

Or maybe it's just not working. Anyway, it's 70GB total and if it takes more than 2-3 days from my 100Mbps server, I will just give up.


Reply to this email directly or view it on GitHub: https://github.com/xybu/onedrive-d/issues/139#issuecomment-81102826

ghost commented 9 years ago

Thanks Xybu. I finally had to give up on the server as it was expiring and I wanted the files to be saved on onedrive before it did.

I couldn't make it work in 4 days I had left. So it expired and I guess I will give up on that 70GB and won't pay $20 for another month. So it's gone.

Thanks for your help and efforts btw.