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

Bug: When syncing I suddenly get sync errors and quote characters (") are added to the path #2823

Closed
Mittlebenskrise opened this issue Sep 18, 2024 · 9 comments · Fixed by #2826 or #2851
Labels
Bug Something isn't working Fixed Regression
Milestone

Comments

@Mittlebenskrise
Copy link

Describe the bug

Until July everything was working fine. Suddenly I get sync errors like this:

The OneDrive Client was asked to search for this directory online and create it if it's not located: ./"Bilder"

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 400 (Bad Request)
  Error Reason:     One or more invalid characters are present in the path (/LiveFolders/"Bilder").
  Error Code:       invalidRequest
  Error Timestamp:  2024-09-18T10:33:05
  API Request ID:   682f30c0-f7cd-4c27-864f-cff60d975966

OneDrive generated an error when creating this path: "Bilder"

ERROR: Microsoft OneDrive API returned an error with the following message:
  Error Message:    HTTP request returned status code 400 (Bad Request)
  Error Reason:     One or more invalid characters are present in the path (/"Bilder").
  Error Code:       invalidRequest
  Error Timestamp:  2024-09-18T10:33:05
  API Request ID:   30bb5ead-3d28-4726-808d-3099ef387859

It seems that the added quote character causes an issue here. Any ideas how to fix this? Here's my docker-compose.yml:

services:
    onedrive:
        image: driveone/onedrive:latest
        container_name: onedrive-photos
        stdin_open: true # docker run -i
        tty: true        # docker run -t
        restart: always
        environment:
            - ONEDRIVE_UID=$PUID
            - ONEDRIVE_GID=$PGID
            - ONEDRIVE_SINGLE_DIRECTORY=Bilder
            - ONEDRIVE_DOWNLOADONLY=1
            - ONEDRIVE_RESYNC=1
        volumes:
            - '$DOCKER_DATA_DIR/onedrive-photos/config:/onedrive/conf'
            - '$PHOTOPRISM_ROOT/originals:/onedrive/data'
        deploy:
          resources:
            limits:
              cpus: '0.50'

Operating System Details

Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

Client Installation Method

From Distribution Package

OneDrive Account Type

Personal

What is your OneDrive Application Version

Can't be retrieved (container is restarting due to error)

What is your OneDrive Application Configuration

Can't be retrieved (container is restarting due to error)

What is your 'curl' version

Can't be retrieved (container is restarting due to error)

Where is your 'sync_dir' located

Local

What are all your system 'mount points'

/dev/sda2 on /media/backup type ext4 (rw,relatime)
/dev/sda1 on /media/ssd type ext4 (rw,relatime)
/dev/sdc1 on /media/extended type ext4 (rw,relatime)
/dev/sdd1 on /media/data type fuseblk (rw,noatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

What are all your local file system partition types

NAME                      FSTYPE      FSVER    LABEL    UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1                    ext4        1.0               8ac2263a-7824-4e3a-a0e5-c02dce8fb479    131,7G    57% /media/ssd
└─sda2                    ext4        1.0               45534dfe-9bff-421c-9499-f0d2b243d9b7       57G    49% /media/backup
sdb
├─sdb1                    vfat        FAT32             D3C1-FCF0                                   1G     1% /boot/efi
├─sdb2                    ext4        1.0               db2d1fbe-e6fe-430a-ba1f-eda3f003b9fd      1,6G     9% /boot
└─sdb3                    LVM2_member LVM2 001          YSejVz-t8mJ-1zZN-Vls5-RocI-z1am-QUJPgz
  └─ubuntu--vg-ubuntu--lv ext4        1.0               dfcc3c01-b089-458e-812c-8f6f55e4c610    199,6G    53% /var/snap/firefox/common/host-hunspell
                                                                                                              /
sdc
└─sdc1                    ext4        1.0               da001b10-2ea8-478b-ae79-873b5cc3e486    535,5G    36% /media/extended
sdd
└─sdd1                    ntfs                 Elements FCD216FAD216B8BA                        533,6G    89% /media/data

How do you use 'onedrive'

My onedrive is synced across multiple systems (Windows, Android). The sync here is only intended to sync my images with my Photoprism installation on Ubuntu.

Steps to reproduce the behaviour

As described above, when I start the container with the docker-compose.yml, I get the path error and the container restarts.

Complete Verbose Log Output

Configuring Global Azure AD Endpoints

The OneDrive Client was asked to search for this directory online and create it if it's not located: ./"Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/LiveFolders/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:41:22

  API Request ID:   6aa4440a-9e15-4734-8bcb-9c6b7737708e



OneDrive generated an error when creating this path: "Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:41:22

  API Request ID:   b478e86c-6fb0-4faa-b937-57f07a2044eb





The requested --single-directory path to sync has generated an error. Please correct this error and try again.



usermod: no changes

# Running container as user: onedrive

# Base Args: --monitor

# We are performing a --resync

# Adding --resync --resync-auth

# We are synchronizing in download-only mode

# Adding --download-only

# We are synchronizing in single-directory mode

# Adding --single-directory ARG

# Changing ownership permissions on /onedrive/data and /onedrive/conf to onedrive:onedrive

# Launching 'onedrive' as onedrive via gosu

Reading configuration file: /onedrive/conf/config

Configuration file successfully loaded

Deleting the saved application sync status ...

Using IPv4 and IPv6 (if configured) for all network operations

Attempting to contact Microsoft OneDrive Login Service

Successfully reached Microsoft OneDrive Login Service

Configuring Global Azure AD Endpoints

The OneDrive Client was asked to search for this directory online and create it if it's not located: ./"Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/LiveFolders/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:42:29

  API Request ID:   146fd903-fd53-4399-85fa-9a18d45bffac



OneDrive generated an error when creating this path: "Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:42:29

  API Request ID:   7adcd9f6-4795-4c3d-9ce2-9b2ed76d21b9





The requested --single-directory path to sync has generated an error. Please correct this error and try again.



usermod: no changes

# Running container as user: onedrive

# Base Args: --monitor

# We are performing a --resync

# Adding --resync --resync-auth

# We are synchronizing in download-only mode

# Adding --download-only

# We are synchronizing in single-directory mode

# Adding --single-directory ARG

# Changing ownership permissions on /onedrive/data and /onedrive/conf to onedrive:onedrive

# Launching 'onedrive' as onedrive via gosu

Reading configuration file: /onedrive/conf/config

Configuration file successfully loaded

Deleting the saved application sync status ...

Using IPv4 and IPv6 (if configured) for all network operations

Attempting to contact Microsoft OneDrive Login Service

Successfully reached Microsoft OneDrive Login Service

Configuring Global Azure AD Endpoints

The OneDrive Client was asked to search for this directory online and create it if it's not located: ./"Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/LiveFolders/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:43:32

  API Request ID:   3655fe20-b0e0-456c-b7f9-df8ad615d0ff



OneDrive generated an error when creating this path: "Bilder"



ERROR: Microsoft OneDrive API returned an error with the following message:

  Error Message:    HTTP request returned status code 400 (Bad Request)

  Error Reason:     One or more invalid characters are present in the path (/"Bilder").

  Error Code:       invalidRequest

  Error Timestamp:  2024-09-18T10:43:32

  API Request ID:   def51da1-6003-449a-93ba-71b2a0c1c303





The requested --single-directory path to sync has generated an error. Please correct this error and try again.

Screenshots

No response

Other Log Information or Details

No response

Additional context

No response

@Mittlebenskrise Mittlebenskrise added the Bug Something isn't working label Sep 18, 2024
@abraunegg
Copy link
Owner

@abraunegg
Copy link
Owner

@Mittlebenskrise
I remember that this was an issue in v2.4 as well - so potentially this is a regression.

abraunegg added a commit that referenced this issue Sep 18, 2024
* Fix regression of extra quotation marks when using ONEDRIVE_SINGLE_DIRECTORY with Docker. Original issue #2318 , original fix #2319
@abraunegg
Copy link
Owner

@Mittlebenskrise
Please use the following instructions to clone this PR:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2826/head:pr2826
git checkout pr2826

Augment the above with the instructions here on building your own Docker container:

https://github.com/abraunegg/onedrive/blob/master/docs/docker.md#building-a-custom-docker-image

When running this PR, your client version should be onedrive v2.5.0-4-g21a20aa or greater and it should have the fix from #2319 implemented. Please can you confirm.

Once confirmed, I will merge this into 'master' and then you can pull an 'edge' Docker tag to get that version.

If this is still not working, please generate a debug log as per: https://github.com/abraunegg/onedrive/wiki/Generate-debug-log-for-support#docker-container-example

@abraunegg
Copy link
Owner

@Mittlebenskrise
Please can you respond

1 similar comment
@abraunegg
Copy link
Owner

@Mittlebenskrise
Please can you respond

@Mittlebenskrise
Copy link
Author

Sorry for the late reply. I was out busy. I followed the instructions and created a local Docker container with the patch. Now, the sync seems to work again. At least there's no error message anymore and the log file looks good as well:

# Launching 'onedrive' as onedrive via gosu
Reading configuration file: /onedrive/conf/config
Configuration file successfully loaded
Deleting the saved application sync status ...
Using IPv4 and IPv6 (if configured) for all network operations
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Configuring Global Azure AD Endpoints
The OneDrive Client was asked to search for this directory online and create it if it's not located: ./Bilder
OneDrive synchronisation interval (seconds): 300
Attempting to contact Microsoft OneDrive Login Service
Successfully reached Microsoft OneDrive Login Service
Starting a sync with Microsoft OneDrive

Thanks for your support! So,I assume this will then be in the next release as well, right?

@abraunegg
Copy link
Owner

@Mittlebenskrise
Thanks for the confirmation of fix.

Yes this will be included in the next release, and if you are using 'edge' Docker tag, this will be available once this is merged into 'master' and those are rebuilt as a result of that process.

abraunegg added a commit that referenced this issue Sep 19, 2024
…NEDRIVE_SINGLE_DIRECTORY with Docker (#2826)

* Fix regression of extra quotation marks when using ONEDRIVE_SINGLE_DIRECTORY with Docker. Original issue #2318 , original fix #2319
@abraunegg
Copy link
Owner

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.

Repository owner locked as resolved and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed Regression
Projects
None yet
2 participants