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

Uploaded file contains the host name. #66

Closed
openedhardware opened this issue Jul 13, 2018 · 7 comments
Closed

Uploaded file contains the host name. #66

openedhardware opened this issue Jul 13, 2018 · 7 comments

Comments

@openedhardware
Copy link

openedhardware commented Jul 13, 2018

Once I update the local file and call onedrive --synchronize --local-first, another file is created on the remote OneDrive with the host name of my PC.

Local file: L01.csv
Remote files: L01.csv & L01-ip-172-31-41-236.csv

  • ip-172-31-41-236 is the hostname of my AWS EC2 instance
  • L01.csv(remote) is not updated but contains the original contents when it was created.
  • Only ip-172-31-41-236.csv is updated whenever I execute the command above.

Which command should I execute to update the remote file only?
(Only the local file is modified and I jsut need to get the remote file updated too)

Cheers.

@openedhardware
Copy link
Author

If I run onedrive --synchronize --local-first --upload-only command, I am getting this error:

ubuntu@ip-172-31-41-236:~$ onedrive --synchronize --upload-only --local-first
Initializing the Synchronization Engine ...
Syncing changes from local path only - NOT syncing data changes from OneDrive ...
Uploading file PeopleCount/L01.csv ...HTTP request returned status code 412 (Precondition Failed)
{
    "error": {
        "code": "notAllowed",
        "innerError": {
            "date": "2018-07-13T19:12:27",
            "request-id": "82625674-f6c4-4d3d-9d69-8eee59b0bf1a"
        },
        "message": "ETag does not match current item's value"
    }
}
Syncing changes from local path only - NOT syncing data changes from OneDrive ...
Uploading file PeopleCount/L01.csv ...HTTP request returned status code 412 (Precondition Failed)
{
    "error": {
        "code": "notAllowed",
        "innerError": {
            "date": "2018-07-13T19:12:27",
            "request-id": "d85710a3-3143-4aeb-b91d-848b33ba256d"
        },
        "message": "ETag does not match current item's value"
    }
}
Syncing changes from local path only - NOT syncing data changes from OneDrive ...
Uploading file PeopleCount/L01.csv ...onedrive.OneDriveException@src/onedrive.d(544): HTTP request returned status code 412 (Precondition Failed)
{
    "error": {
        "code": "notAllowed",
        "innerError": {
            "date": "2018-07-13T19:12:27",
            "request-id": "4cec73b1-bf1b-4c6c-88ee-59bfe905e83a"
        },
        "message": "ETag does not match current item's value"
    }
}
----------------
src/onedrive.d:33 void onedrive.OneDriveApi.checkHttpCode(ref const(std.json.JSONValue)) [0x5a1a34]
src/onedrive.d:393 std.json.JSONValue onedrive.OneDriveApi.upload(immutable(char)[], immutable(char)[]) [0x5a12f1]
src/onedrive.d:147 std.json.JSONValue onedrive.OneDriveApi.simpleUploadReplace(immutable(char)[], immutable(char)[], immutable(char)[], const(char)[]) [0x59ffc3]
src/sync.d:837 void sync.SyncEngine.uploadFileDifferences(itemdb.Item, immutable(char)[]) [0x5adaa4]
src/sync.d:760 void sync.SyncEngine.uploadDifferences(itemdb.Item) [0x5ad3e4]
src/sync.d:780 void sync.SyncEngine.uploadDirDifferences(itemdb.Item, immutable(char)[]) [0x5ad5a1]
src/sync.d:757 void sync.SyncEngine.uploadDifferences(itemdb.Item) [0x5ad3b1]
src/sync.d:780 void sync.SyncEngine.uploadDirDifferences(itemdb.Item, immutable(char)[]) [0x5ad5a1]
src/sync.d:757 void sync.SyncEngine.uploadDifferences(itemdb.Item) [0x5ad3b1]
src/sync.d:720 void sync.SyncEngine.scanForDifferences(immutable(char)[]) [0x5ad1e1]
src/main.d:360 void main.performSync(sync.SyncEngine, immutable(char)[], bool, bool, bool) [0x5922ab]
src/main.d:244 _Dmain [0x591c3f]

What is the easiest way to upload from my local PC to the remote drive only?

@abraunegg
Copy link
Owner

abraunegg commented Jul 13, 2018

Which command should I execute to update the remote file only?

The command to use should be onedrive --synchronize --upload-only

Edit:
See comments below

@abraunegg
Copy link
Owner

abraunegg commented Jul 13, 2018

Can you please test PR #67?

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/67/head:pr67
git checkout pr67
make
make install

@abraunegg abraunegg added the Bug Something isn't working label Jul 13, 2018
@abraunegg
Copy link
Owner

I am also currently looking at the logic of --upload-only and --local-first - there appears to be some logic issues with the code to which I am currently resolving as well

abraunegg added a commit that referenced this issue Jul 15, 2018
* Fix systemd service install for builds with DESTDIR defined (#68)

* Update logic --upload-only and --local-first (#71)

* Update the logic handling of --upload-only and --local-first to be more consistent regardless of using --single-directory or not.
@openedhardware
Copy link
Author

openedhardware commented Jul 15, 2018

@abraunegg

Not sure what the reason was, but now it is working well with onedrive --synchronize --local-first --upload-only command...

Closing this issue...

@abraunegg
Copy link
Owner

Glad it is resolved, however I would rebuild using the latest commit so that you only need to use:

onedrive --synchronize --upload-only

By using that combination, the client would potentially be also syncing changes from OneDrive.

@lock
Copy link

lock bot commented Jan 6, 2019

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

@lock lock bot locked and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants