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

Failure to start gvfs.service in docker #1692

Open
luceCoding opened this issue Sep 22, 2020 · 3 comments
Open

Failure to start gvfs.service in docker #1692

luceCoding opened this issue Sep 22, 2020 · 3 comments

Comments

@luceCoding
Copy link

luceCoding commented Sep 22, 2020

I am not able to mount a repo in docker with gvfs.
Error:

Cloning...Succeeded
Fetching commits and trees from origin (no cache server)...Succeeded
Attaching ProjFS to volume...Failed. Run 'gvfs log C:\project\Solutions' for more info.
GVFS.Service is not responding. Run 'sc start GVFS.Service' from an elevated command prompt to ensure it is running.

Even running the commands as container admin still fails.

When I run the powershell command:

Get-service gvfs.service

Status   Name               DisplayName
------   ----               -----------
Stopped  GVFS.Service       gvfs.service

It shows it has stopped. When trying to restart it, it fails to start.

restart-service : Failed to start service 'gvfs.service (GVFS.Service)'.
At line:1 char:1
+ restart-service gvfs.service
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceControl
   ler:ServiceController) [Restart-Service], ServiceCommandException
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands
   .RestartServiceCommand

Here are mount logs, scrubbed my git links for personal reasons:

[2020-09-22 10:44:39.0016 -07:00] ExecuteMount (Start) {"Version":"1.0.20210.1","EnlistmentRoot":"C:\\project\\Solutions","Remote":"<SCRUBBED>","ObjectsEndpoint":"<SCRUBBED>","Unattended":false,"IsElevated":true,"NamedPipeName":"GVFS_C_\\PROJECT\\SOLUTIONS","EnlistmentRootPathParameter":"C:\\project\\Solutions"}
[2020-09-22 10:44:41.7156 -07:00] MountVerb_Execute_EnablingKernelDriverViaService {"KernelDriver.IsReady_Error":"","Message":"Service will retry"}
[2020-09-22 10:44:44.7210 -07:00] Error {"ErrorMessage":"GVFS.Service is not responding. Run 'sc start GVFS.Service' from an elevated command prompt to ensure it is running."}
[2020-09-22 10:44:44.7210 -07:00] ExecuteMount (Stop) {"DurationMs":6125}

Docker version 19.03.12, build 48a66213fe
Dockerfile:

# escape=`

FROM mcr.microsoft.com/windows:1903

WORKDIR C:\project

# Restore the default Windows shell for correct batch processing.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; $VerbosePreference = 'Continue';"]

ADD https://github.com/microsoft/VFSForGit/releases/download/v1.0.20210.1/Git-2.28.0.vfs.0.0-64-bit.exe C:\TEMP\Git-2.28.0.vfs.0.0-64-bit.exe
ADD https://github.com/microsoft/VFSForGit/releases/download/v1.0.20210.1/SetupGVFS.1.0.20210.1.exe C:\TEMP\SetupGVFS.1.0.20210.1.exe

RUN Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart
RUN Start-Process -Wait -FilePath C:\TEMP\SetupGVFS.1.0.20210.1.exe -ArgumentList @('/VERYSILENT', '/SP-', '/SUPPRESSMSGBOXES') | Wait-Process -Timeout 60 -ErrorAction SilentlyContinue -ErrorVariable timeouted

RUN Start-Process -Wait -FilePath C:\TEMP\Git-2.28.0.vfs.0.0-64-bit.exe -ArgumentList @('/VERYSILENT', '/SP-', '/SUPPRESSMSGBOXES')

ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Unrestricted"]]
@derrickstolee
Copy link
Contributor

The ProjFS filter driver needs to be running on "bare-metal" Windows, so I'm not surprised that Docker fails in this scenario.

Could you explain more about your scenario and why you want to clone using VFS for Git in Docker?

@luceCoding
Copy link
Author

Currently trying to create a docker build environment for enterprise scale repos. We can't afford to download 20GB+ size repos.

@derrickstolee
Copy link
Contributor

Currently trying to create a docker build environment for enterprise scale repos. We can't afford to download 20GB+ size repos.

Perhaps you would still be interested in Scalar which uses the same protocol as VFS for Git (when cloning from Azure Repos) but doesn't have the requirement of a filesystem driver? If you are doing a build that requires most of the files in the working directory, then consider running the following:

scalar clone --full-clone <url>

See the Getting Started documentation for more details.

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