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

drive push behavior is erratic when another .gd is present in any subfolder #829

Closed
jean-christophe-manciot opened this issue Jan 6, 2017 · 4 comments

Comments

@jean-christophe-manciot
Copy link

jean-christophe-manciot commented Jan 6, 2017

I know how this sounds, it is a strange issue. I'm as surprised as I guess you are.
Here is the situation:

  1. Local folders from root GD folder
Google Drive# ll
Android -> /home/actionmystique/Program-Files/Android/
Cisco -> /home/actionmystique/Program-Files/Cisco/
Downloads -> /home/actionmystique/Downloads/
.driveignore*
.driverc*
.driveselect*
.gd/
Issues -> /home/actionmystique/Issues/
Missions/
Pictures -> /home/actionmystique/Pictures/
Test/
Ubuntu -> /home/actionmystique/Program-Files/Ubuntu/
  1. Remote objects
Mostly a bunch of PDFs

Now, the issue: I'm just trying to push the folder "Test" with an infinite depth (-1).
The result does not make any sense:

Google Drive# drive push Test
Resolving...
- /Missions
- /Missions/Certifications
- /Missions/Certifications/IPv6 Forum
- /Missions/Certifications/IPv6 Forum/IPv6 Gold.jpg
- /Missions/Certifications/Cisco
- /Missions/Certifications/Cisco/CCDP
- /Missions/Certifications/Cisco/CCDP/Logo
- /Missions/Certifications/Cisco/CCDP/Logo/JPEG
- /Missions/Certifications/Cisco/CCDP/Logo/JPEG/300x300px
- /Missions/Certifications/Cisco/CCDP/Logo/JPEG/300x300px/ccdp_design_large.jpg
- /Missions/Certifications/Cisco/CCDP/ARCH
- /Missions/Certifications/Cisco/CCDP/ARCH/Jean-Christophe's Guides
- /Missions/Certifications/Cisco/CCDP/ARCH/Jean-Christophe's Guides/Summary
- /Missions/Certifications/Cisco/CCDP/ARCH/Jean-Christophe's Guides/Summary/Cisco & Partners Network & Security Architecture - Cloud-DC Design Excerpt.pdf
-... all my PDFs
+ /Google
+ /Google/Chrome
+ /Google/G+ Collections
+ ...and all their contents
Deletion count 64 dest: 252.17MB
Addition count 114 src: 92.58MB
Proceed with the changes? [Y/n]:n

It does not make sense because:

  • drive should not deal with anything outside Test
  • drive tries to push a folder 'Google' which is ... not in the current folder, but below 'Downloads'
  • drive does not try to push Test which is not available remotely

My suspicion goes to the fact that my local GD root folder has a space within (Google Drive) which seems to completely disorient drive.
The local symlinks may also confuse drive.

@jean-christophe-manciot
Copy link
Author

I have the latest drive version installed:

# drive version
drive version: 0.3.8.1
Commit Hash: 'be79a211364f0e0b8f83998eb2c4551577a25dbd'
Go Version: go1.7.1
OS: linux/amd64
BuildTime: 2017-01-05 14:55:19.720486571 +0100 CET

@jean-christophe-manciot jean-christophe-manciot changed the title drive push behavior is erratic drive push behavior is erratic when another .gd is present in any subfolder Jan 6, 2017
@jean-christophe-manciot
Copy link
Author

jean-christophe-manciot commented Jan 6, 2017

I have found what triggers that issue and I have to admit it should be a rare case.
For testing purposes, I have previously copied .gd folder into that Test folder. If I remove Test/.gd (leaving the original .gd the only one), the issue is gone.

odeke-em added a commit that referenced this issue Jan 7, 2017
Introduce DebugPrintf which can be used to give
contextual and debug information when things go wrong
and we need to observe them, when verbose or `DEBUG=true`
is set in the environment.

So far added debugging prints when parsing the .driverc file.
It prints out the:
[<FILE>:<FUNCTION>:<LINE_NUMBER>]

Prefix a drive invocation with `DEBUG=true`
```shell
$ DEBUG=true drive list share-testing/
[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/cmd/drive/main.go:main.discoverContext:1857]
contextPath: /Users/emmanuelodeke/emm.odeke@gmail.com/share-testing
[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/cmd/drive/main.go:main.discoverContext:1867]
driveRoot: "/Users/emmanuelodeke/emm.odeke@gmail.com" relToRoot: ""

[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/src/rc.go:github.com/odeke-em/drive/src.ResourceMappings:92]
RCPath: /Users/emmanuelodeke/emm.odeke@gmail.com/share-testing/.driverc
[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/src/rc.go:github.com/odeke-em/drive/src.ResourceMappings:108]
parsedContent from
"/Users/emmanuelodeke/emm.odeke@gmail.com/share-testing/.driverc"
{
  "global": {
    "depth": -1
  }
}
[Commands.List] #0 "/share-testing"
-- owner       175.00B	  0Bwu8laYc9RTPa28zVk9Td2hTVWc	  2016-06-30
15:32:25 +0000 UTC  /share-testing/SciqPCKrhi.go
-- owner       309.00B	  0Bwu8laYc9RTPTXRYblNqQXBSQzQ	  2016-02-03
08:12:15 +0000 UTC  /share-testing/outf.go
-s owner       39.70KB	  0Bwu8laYc9RTPOVNSeElpdFBpS2M	  2012-02-02
12:00:00 +0000 UTC  /share-testing/ComedyPunchlineDrumSound.mp3
```

It will alleviate #829
since the reporter could then investigate and see the .gd path and
.driverc paths that were being read from.
@odeke-em
Copy link
Owner

odeke-em commented Jan 7, 2017

@jean-christophe-manciot thanks for reporting this.

So if you put a .gd file in any directory, that makes that directory the root. That means therefore that if you make a push operation, then it will be relative to that root.

Unfortunately in the past there was no where to debug that information.
However, now with #830 and #831, I've added the ability for you to
add DRIVE_DEBUG=true drive push in your environment and you'll get such output
that will help you inspect where the root is derived from as well as your .driverc.

[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/cmd/drive/main.go:main.discoverContext:1857]
contextPath: "/Users/emmanuelodeke/emm.odeke@gmail.com/share-testing"
[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/cmd/drive/main.go:main.discoverContext:1867]
driveRoot: "/Users/emmanuelodeke/emm.odeke@gmail.com" relToRoot: ""


[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/src/rc.go:github.com/odeke-em/drive/src.ResourceMappings:92]
RCPath: /Users/emmanuelodeke/emm.odeke@gmail.com/.driverc
[/Users/emmanuelodeke/go/src/github.com/odeke-em/drive/src/rc.go:github.com/odeke-em/drive/src.ResourceMappings:108]
parsedContent from "/Users/emmanuelodeke/emm.odeke@gmail.com/.driverc"

@jean-christophe-manciot
Copy link
Author

Shouldn't it stop at the first found .gd folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants