JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
Apache License 2.0
11.23k stars 1.05k forks source link

Fails to startup #3290

Closed humor4fun closed 1 month ago

humor4fun commented 1 month ago

Checklist

ASF version

Latest stable release

ASF variant

win-x64

Bug description

One day after running normally for many weeks i went to start ASF up and it just refused to load throwing me this error message. So I went to get the latest version and it shows the same error message when i try to run the exe.

Expected behavior

ASF runs

Actual behavior

ASF throws this error, stalls for about 10 seconds, then closes

Steps to reproduce

No response

Possible reason/solution

No response

Can you help us with this bug report?

Somehow, I can test and offer feedback, but can't code

Full log.txt recorded during reproducing the problem

2024-09-14 07:19:53|ArchiSteamFarm-29060|INFO|ASF|InitCore() ArchiSteamFarm V6.0.6.4 (win-x64/c69f4b182bda4a5f9610bbc3a193bf24 | .NET 8.0.8; win-x64; Microsoft Windows 10.0.22631) in [C:\Users\holtc\Documents\Tools\ASF-win-x64]
2024-09-14 07:19:53|ArchiSteamFarm-29060|INFO|ASF|InitCore() Copyright © 2015-2024 JustArchiNET
2024-09-14 07:19:53|ArchiSteamFarm-29060|INFO|ASF|InitPlugins() Initializing Plugins...
2024-09-14 07:19:53|ArchiSteamFarm-29060|ERROR|ASF|InitPlugins() System.TypeLoadException
   at System.ModuleHandle.ResolveType(QCallModule, Int32, IntPtr*, Int32, IntPtr*, Int32, ObjectHandleOnStack)
   at System.ModuleHandle.ResolveTypeHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])
   at System.Reflection.RuntimeModule.ResolveType(Int32, Type[], Type[])
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken, MetadataImport& , RuntimeModule, MetadataToken, RuntimeType, Boolean, ListBuilder`1&, RuntimeType& , IRuntimeMethodInfo& , Boolean& )
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1&, RuntimeModule, Int32, RuntimeType, Boolean, ListBuilder`1)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule, Int32, Int32, RuntimeType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType, RuntimeType, Boolean)
   at System.RuntimeType.GetCustomAttributes(Type, Boolean)
   at System.Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes(MemberInfo, Type, Boolean)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](MemberInfo, Boolean)
   at System.Composition.Convention.ConventionBuilder.GetCustomAttributes(Type reflectedType, MemberInfo member)
   at System.Composition.Convention.AttributedModelProviderExtensions.GetDeclaredAttribute[TAttribute](AttributedModelProvider convention, Type reflectedType, MemberInfo member)
   at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart(TypeInfo type, DiscoveredPart& part)
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at ArchiSteamFarm.Plugins.PluginsCore.InitPlugins()

Global ASF.json config file

No response

BotName.json config of all affected bot instances

{
  "Enabled": true,
  "FarmingPreferences": 128,
  "RedeemingPreferences": 4,
  "SteamLogin": "xxx",
  "SteamPassword": "xxx",
  "EnableFreePackages": true
}

Additional info

No response

JustArchi commented 1 month ago

Hey there! Thank you for contacting our development team at GitHub.

We believe that your issue does not meet our contributing guidelines referenced during issue creation.

Before you open an issue please review the contributing guidelines for this repository. (...) I understand that if my issue is not meeting contributing guidelines specified above, especially if it's a question or technical issue that is not related to ASF development in any way, then it will be closed and left unanswered.

Reason for closing: technical difficulties using the program are not related to ASF development. Use appropriate support channel instead.

Please check out our wiki if you need further help.

Have a nice day! ~Archi

nolddor commented 1 month ago

Looks like you are using a third-party plugin causing the issues. Contact your third-party vendor instead.

humor4fun commented 1 month ago

It would be useful if the log indicated what plugin was being loaded at the time of the error.

JustArchi commented 1 month ago

If ASF knew which plugin was causing that then it'd let you know.

Abrynos commented 1 month ago

@JustArchi since we're not loading plugins in parallel, I believe we could add a "debug" log before the call to Assembly.LoadFrom(assemblyPath) in which we log the path to the binary. Imagine it such as Attempting to load plugin from file: {0}

Edit: related code

JustArchi commented 1 month ago

@Abrynos next time analyze better.

Rudokhvist commented 1 month ago

But wouldn't this exceptions still happen AFTER assembly load? I'm sorry, I don't understand how it works, just asking.

JustArchi commented 1 month ago

As you can see from existing code, no, assembly load works fine, using it fails, and we can't call every single function, property, interface, class and explore every single line of assembly to determine whether or not it's valid.

If ASF knew which plugin was causing that then it'd let you know.

If you have actual code suggestion how to improve this part, send a PR.

JustArchi commented 1 month ago

I've added https://github.com/JustArchiNET/ArchiSteamFarm/commit/a27973800c2bc2e4edc956d291cc0e76b211d0c3 to give slightly more info, as that's the only thing ASF can possibly do in this case that comes to my mind.