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

Gitbase doesn't work on Windows if it has to traverse a directory for which the access is not authorized #718

Closed
se7entyse7en opened this issue Mar 5, 2019 · 7 comments
Assignees
Labels
bug Something isn't working empathy Issue filed as as part of empathy sessions

Comments

@se7entyse7en
Copy link

This was discovered while fixing this bug on Engine.

Problem

Version affected: v0.19.0-rc1

On Windows, when the guest path contains some directories for which the access is denied, then gitbase doesn't add any repository, but it doesn't exit. Then engine always just returns an empty result for queries.

screenshot 2019-03-05 at 17 18 05

Expected behaviour

The expected behavior is that it exits with an error or just ignores those directories. I think that ignoring those directories should require only to return filepath.SkipDir when the error passed to the walk function is an access denied.

Some details

To debug this issue In the Windows development machine I've created the gitbase-testing image that comes with the gitbase source code, git and dlv for debugging. I ran it as follows:

docker run --security-opt=seccomp:unconfined --mount type=bind,source=C:\Users,target=/opt/repos -it gitbase-testing /bin/sh

and then I ran:

dlv debug cmd/gitbase/main.go -- server -v --host=0.0.0.0 --port=3306 --user=root --password="" --directories=/opt/repos

I've added a break using break /usr/local/go/src/path/filepath/path.go:375, ran continue 5 times and then step until line 362. Here's what happens:

screenshot 2019-03-05 at 17 24 10

About that C:\Users\Default\AppData\Local\Application Data directory

The weird thing is that if you go to C:\Users\Default\AppData\Local using the Windows File Explorer, there's no Application Data directory even if you ask to show hidden files. Using the shell you can actually cd into it, but once inside that you're not able to do ls. Even running powershell with admin privileges doesn't help.

screenshot 2019-03-05 at 17 39 48

@erizocosmico
Copy link
Contributor

Can't install a windows virtual image, it doesn't fit in my computer (40GB and I just have 18 left). Windows dev machine can't be used today because apps is using it for a demo. So if someone with space and/or a windows machine can take this it would be nice.

@se7entyse7en
Copy link
Author

Just FYI I personally had some problems in running Windows locally both using VBox and VMWare, see here. In case you're gonna try and are successful it would be useful if you could share the steps to make it work.

@se7entyse7en
Copy link
Author

Well actually without docker should be fine. 😄

@ajnavarro
Copy link
Contributor

ajnavarro commented Mar 19, 2019

@erizocosmico I think the main problem here is we stop walking the folder if we have no access permissions in one of the folders inside. Maybe we can reproduce this problem on linux too.

@erizocosmico
Copy link
Contributor

@se7entyse7en do you know if this happens in linux as well?

@se7entyse7en
Copy link
Author

se7entyse7en commented Mar 19, 2019

@erizocosmico I don't know, but it never happened to me and I think it never happened to anyone of @src-d/applications (we are 2 OSX and 2 linux).

@smacker
Copy link

smacker commented Mar 19, 2019

Never happened to me but most probably if you create a folder inside repositories path with limited access only to root, for example, you should be able to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working empathy Issue filed as as part of empathy sessions
Projects
None yet
Development

No branches or pull requests

4 participants