SteamRE / DepotDownloader

Steam depot downloader utilizing the SteamKit2 library.
GNU General Public License v2.0
1.98k stars 268 forks source link

Logging anonymously into Steam3...Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/sys/class/net'. #566

Closed Pandapip1 closed 2 weeks ago

Pandapip1 commented 2 weeks ago

What did you expect to happen?

I expected the program not to crash.

Instead of that, what actually happened?

The program crashed and core dumped.

Which operating system are you running on?

Linux

Version

2.7.2

Command

DepotDownloader -app "250820" -depot "250824" -manifest "5862217504045387455" -loginid 101619330 -dir $out

Relevant log output

No username given. Using anonymous account with dedicated server subscription.
Connecting to Steam3... Done!
Logging anonymously into Steam3...Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/sys/class/net'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at SteamKit2.LinuxMachineInfoProvider.GetMacAddresses(Boolean checkForPhysicalDevice)
   at SteamKit2.LinuxMachineInfoProvider.GetMacAddress()
   at SteamKit2.HardwareUtils.GenerateMachineID(Object state)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at SteamKit2.HardwareUtils.GetMachineID(IMachineInfoProvider machineInfoProvider)
   at SteamKit2.SteamUser.LogOnAnonymous(AnonymousLogOnDetails details)
   at SteamKit2.SteamUser.LogOnAnonymous()
   at DepotDownloader.Steam3Session.ConnectedCallback(ConnectedCallback connected) in /build/source/DepotDownloader/Steam3Session.cs:line 478
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
/build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 14:     8 Aborted                 (core dumped) DepotDownloader -app "250820" -depot "250824" -manifest "5862217504045387455"  -loginid 101619330 -dir $out

Additional Information

I run depotdownloader in a sandboxed environment (a Nix build environment, to be specific) that doesn't have access to most of the system for security reasons. The culprit is something in between 2.5.0 and 2.7.2.

I've tried to reproduce this with bubblewrap, but I am unable to for some reason. I will continue to investigate.

xPaw commented 2 weeks ago

Why didn't you test 2.7.3

Pandapip1 commented 2 weeks ago

Why didn't you test 2.7.3

It isn't the latest version present in nixpkgs. I'll test it later.

xPaw commented 2 weeks ago

Nix packages are not managed by us.

Pandapip1 commented 2 weeks ago

I'm well aware. This isn't a nix packaging problem, though. This is a problem that occurs when depotdownloader is used within a nix build environment. I'm sorry I haven't gathered quite enough data yet, I'll reopen an issue when I can give you a MRE.

yuuko-partyvan commented 2 days ago

for the benefit of other nixers that find this issue, the problem is exclusive to 2.7.2 and 2.7.3 due to the version of steamkit that gets pulled -- it was a little too exuberant in poking through /sys/class/net, which of course is not available in a nix sandbox. 2.7.4 pulls 3.0.0 proper, not beta, which fixes this. if you are not inclined to wait for 2.7.4 to land in nixpkgs (which in turn will need dotnet-sdk_9 to land), quick and dirty fix is to patch SteamKit2 in depotdownloader's BuildInputs such that GetMacAddresses reads something like:

static List<byte[]> GetMacAddresses( bool checkForPhysicalDevice = true )
{
    return new List<byte[]>();
}

and it'll work for all your nix expressions that need to fetch steam content.

example to pull from can be found here though there are some other patches in there so be careful blindly copypasting