question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet build fails on nfs

See original GitHub issue

Steps to reproduce

(On a nfs mount)

dotnet new dotnet restore dotnet build

Expected behavior

build succeeds

Actual behavior

build fails with: Access to the path '/home/damageboy/projects//dotnet-sample/obj/Debug/dnxcore50/dotnet-compile.rsp' is denied.

Environment data

dotnet --version output:

.NET Command Line Tools (1.0.0-dev-001698)

Product Information:
 Version:     1.0.0-dev-001698
 Commit Sha:  N/A

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 Runtime Id:  ubuntu.14.04-x64

More information:

I thinks this boils down to some weird locking behavior on nfs vs local file systems:

Bad run (NFS)

Here’s a snippet of strace -o bad.log dotnet build output of a run done to produce the same error:

open("/home/damageboy/projects/dotnet-sample/obj/Debug/dnxcore50/dotnet-compile.rsp", O_WRONLY|O_CREAT|O_TRUNC, 0700) = 77
fstat(77, {st_mode=S_IFREG|0700, st_size=0, ...}) = 0
flock(77, LOCK_SH|LOCK_NB)              = -1 EBADF (Bad file descriptor)

Notice the bad flock() return value, it’s pretty clear it all goes down hill from there, here’s the full strace: bad.log

Good run (/tmp)

Again, here’s a snipped of strace -o good.log dotnet build output that succeeds:

open("/tmp/dotnet-sample/obj/Debug/dnxcore50/dotnet-compile.rsp", O_WRONLY|O_CREAT|O_TRUNC, 0700) = 77
fstat(77, {st_mode=S_IFREG|0700, st_size=0, ...}) = 0
flock(77, LOCK_SH|LOCK_NB)              = 0

Notice how flock() successfully

Again here is the full strace output: good.log

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
blackdwarfcommented, Jan 12, 2017

Guys, there is an issue opened on the dotnet/core#15120 as this is really something we should track and discuss there. Will close this one.

1reaction
ah-commented, Jul 11, 2016

I’m running into the same issue. Sharing one home directory on a NetApp between Linux and Windows, and can’t build using dotnet cli on Linux where it’s mounted via NFS.

Have you looked into fcntl to do the locking?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dotnet CLI fails building after mv to other directory?
I've tried them seperately and found out that the 'dotnet build' command gives the error. The git repo was completely empty, I just...
Read more >
NFS deathlock with last Kernel 5.4.0-144.161 and 5.15.0-67.74
After updating on the kernel 5.4.0-144.161 at Ubuntu 18 and 5.15.0-67.74 at Ubuntu 20, we have a 100% CPU outlation and 20 to...
Read more >
dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >
Persistent Storage Using NFS - OpenShift Documentation
The pod fails for the following reasons: It requests 65534 as its user ID. All SCCs available to the pod are examined to...
Read more >
Fix: You must install .NET Core error - YouTube
Getting the "To run this application, you must install . NET Core." error ? Well it's a super simple fix that you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found