Cannot complete first run when using small tmpfs for /tmp: "No space left on device" error
See original GitHub issueSteps to reproduce
- Create a Fedora 23 machine with 1GB RAM. This, by default, creates /tmp using the in-memory tmpfs set to 500 MB.
- Run
dotnet (anything)
to trigger first run nuget cache priming
Expected behavior
Prime nuget cache succeeds
Actual behavior
This fills /tmp and crashes. There is no obvious way for user to opt-out of first run.
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 2628 ms
Expanding 74%
Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (No space left on device)) (One or more errors occurred. (No space left on device)) (No space left on device) (No space left on device) ---> System.IO.IOException: No space left on device
at System.IO.UnixFileStream.CheckFileCall(Int64 result, Boolean ignoreNotSupported)
at System.IO.UnixFileStream.WriteNative(Byte[] array, Int32 offset, Int32 count)
at System.IO.UnixFileStream.FlushWriteBuffer()
at System.IO.UnixFileStream.Dispose(Boolean disposing)
at System.IO.FileStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Compression.ZipArchive.CloseStreams()
at System.IO.Compression.ZipArchive.Dispose(Boolean disposing)
at System.IO.Compression.ZipArchive.Dispose()
at Microsoft.DotNet.Archive.IndexedArchive.ZipOperation.Execute()
at Microsoft.DotNet.Archive.IndexedArchive.ExtractOperation.DoOperation()
at Microsoft.DotNet.Archive.IndexedArchive.<>c__DisplayClass19_1.<Extract>b__0(ExtractOperation extractOperation)
at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
at System.Linq.Parallel.SpoolingTaskBase.Work()
at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
at System.Linq.Parallel.QueryTask.RunTaskSynchronously(Object o)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose)
at System.Linq.Parallel.MergeExecutor`1.Execute()
at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId)
at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2 partitionedStream)
at System.Linq.Parallel.ForAllOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, Boolean preferStriping, QuerySettings settings)
at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2 inputStream)
at System.Linq.Parallel.ListQueryResults`1.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
at System.Linq.Parallel.ForAllOperator`1.RunSynchronously()
at System.Linq.ParallelEnumerable.ForAll[TSource](ParallelQuery`1 source, Action`1 action)
at Microsoft.DotNet.Archive.IndexedArchive.Extract(String compressedArchivePath, String outputDirectory, IProgress`1 progress)
at Microsoft.DotNet.Configurer.NuGetPackagesArchiver.ExtractArchive()
at Microsoft.DotNet.Configurer.NuGetCachePrimer.PrimeCache()
at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(INuGetCacheSentinel nugetCacheSentinel)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
After run:
$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 495M 495M 4.0K 100% /tmp
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview2-003118)
Product Information:
Version: 1.0.0-preview2-003118
Commit SHA-1 hash: 7ada53d523
Runtime Environment:
OS Name: fedora
OS Version: 23
OS Platform: Linux
RID: fedora.23-x64
Changes to consider
- Put the env variable in first run message so users more easily find out how to skip this
- Allow specifying which directory to use during extraction
- Cleanup tmp dir if extraction fails
- Run extraction into nuget cache directly instead of into tmp dir first.
Workaround
Set environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true permanently (e.g. add to .bashrc or something).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Tab completion errors: bash: cannot create temp file for ...
I was able to get tab-completion working for the time being by mounting a temporary filesystem in /tmp ( sudo mount -t tmpfs...
Read more >No space left on device error, but df reports as more ...
So my best advice is to run the following command to remove & rebuidl the /tmp directory. Then - sessions will be stored...
Read more >tmpfs running out of inodes ENOSPC: no space left on ...
Now my /tmp directory still has some space left, but the tool seems to use all the FS inodes. $ df -h /tmp/...
Read more >Having problem with /tmp "No space left on device" Error
Your /tmp is a tmpfs, that means it isn't on your hard disk, but it is using your RAM to store its contents....
Read more >Not enough space on /tmp
To do 2: Open a terminal and run sudo umount /tmp or, if that fails, sudo umount -l /tmp . Then clean up!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This depends on what shell you are using. If you don’t know, it is probably bash. For that, add the following line to your
~/.bashrc
file. This is a file named.bashrc
in your home directory. If the file doesn’t exist, create it.Then log out and login again. You can verify that this worked by doing:
You should see:
When you run
dotnet
now, you shouldn’t see the first run message or the error.We have removed the lzma cache expansion logic from the 3.0 CLI already. Closing this issue.