abraunegg / onedrive

OneDrive Client for Linux
https://abraunegg.github.io
GNU General Public License v3.0
10.05k stars 859 forks source link

Bug: after month of working no connection possible #2416

Closed Entwicklungsleiter closed 1 year ago

Entwicklungsleiter commented 1 year ago

Describe the bug

First: THANKS for this onedrive client and even more thanks for this easy setup with docker container. Guess someone does great work and You (as a Linux based developer) can collaborate with You Windows based company in MINUTES. Amazing, You made my life easier!

The problem: I did setup onedrive with docker months ago and it worked well. Today I discovered newest local changes are not uploaded and vice versa. So I cleaned up everything (volumes, images, containers) and restarted docker container:

docker system prune -f
docker pull driveone/onedrive:edge
docker run -it --name onedrive -v "${HOME}/OneDrive/config:/onedrive/conf" -v "${HOME}/OneDrive/data:/onedrive/data" -e "ONEDRIVE_UID=1000" -e "ONEDRIVE_GID=1000" driveone/onedrive:edge

The output I get is:

Base Args: --monitor
# Launching onedrive
Configuration file successfully loaded

Cannot connect to Microsoft OneDrive Service - Network Connection Issue
ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    Timeout was reached on handle <cut out>

The last message ("Cannot connect..") repeats infinitely.

I also tried to "reset" everything and restart:

docker system prune -f
rm config/refresh_token
docker image rmi ...
docker volume rm ...

I also tried to get URL (found in code) manually:

curl -v https://login.microsoftonline.com
*   Trying 40.126.31.71:443...
* Connected to login.microsoftonline.com (40.126.31.71) port 443 (#0)
....
*  SSL certificate verify ok.
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> GET / HTTP/1.1
> Host: login.microsoftonline.com
> User-Agent: curl/7.81.0
> Accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Cache-Control: no-store, no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Expires: -1
< Location: https://www.office.com/login#
...
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.office.com/login#">here</a>.</h2>
</body></html>
* Connection #0 to host login.microsoftonline.com left intact

It looks like Microsoft changed its URLs and the onedrive client cannot handle a 302 moved response.

Operating System Details

- Ubuntu 22.04
- Docker 20.10.21 from Ubuntu repo
- driveone/onedrive edge from tonight (2023-06-12)

Client Installation Method

From 3rd Party Source (PPA, OpenSuSE Build Service etc)

OneDrive Account Type

Business | Office365

What is your OneDrive Application Version

last docker image from 2023-06-12

What is your OneDrive Application Configuration

sync_business_shared_folders = "true"
sync_dir_permissions = "775"
sync_file_permissions = "664"

What is your 'curl' version

7.81.0 from Ubuntu 22.04 repo

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

- some mount from snap (spotify, teams, ...)
- local NVME disk
- system mounts like /dev and /proc

What are all your local file system partition types

NVME LVM2

How do you use 'onedrive'

from docker container driveone/onedrive:edge

Steps to reproduce the behaviour

listed above in description

Complete Verbose Log Output

listed above in description

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

abraunegg commented 1 year ago

@Entwicklungsleiter

Cannot connect to Microsoft OneDrive Service - Network Connection Issue
ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    Timeout was reached on handle <cut out>

You have hit a known issue, but this is not an issue with the client - but your network and network stack. Please read: https://github.com/abraunegg/onedrive/wiki/Frequently-Asked-Questions#cannot-connect-to-microsoft-onedrive-service---network-connection-issue

Essentially your Ubuntu platform has a DNS bug. You need to complain to Ubuntu (and good luck with that) and get them to fix their DNS resolver so that it can correctly respond with IPv4 and IPv6 responses at the same time.

The work around fix is that you most likely need to add the following into your /etc/resolv.conf file:

options single-request

The alternative here is for you to disable IPv6 if you are not using it.

Unfortunately this is not a bug - sorry.

Entwicklungsleiter commented 1 year ago

Thanks for Your quick response. I verified Your description by re-trying to start the docker container in another Wifi environment (at home). It worked. I will talk to network admins in company environment to solve this issue. Thanks a lot!

abraunegg commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.