KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.96k stars 349 forks source link

CKAN GUI not appearing on mac OS #1844

Closed kristvanbesien closed 6 years ago

kristvanbesien commented 8 years ago

Thanks for wanting to bring an issue to our attention!

Before you open a ticket, please do a quick search of the existing issues to see if it's already been brought up.

CKAN Version: v1.18.1-0-g0d2c4f0 (beta)

Operating System: OS X 10.11.6 (15G31)

The issue you are experiencing: GUI is not appearing. Commands like ckan help, ckan list etc. work. But "ckan gui" or just "ckan" does not lead to a gui appearing... What does appear is a blank "mono" labeled on the task bar. Right clicking on that shows that the application is not responding.

How to recreate this issue: Install altest mono. Install ckan. Run ckan

CKAN error codes (if applicable):

politas commented 8 years ago

What is your Mono version?

ayan4m1 commented 8 years ago

Looks like El Cap (OSX 10.11) also broke a few Mono/Darwin base things that might affect this.

http://mono.1490590.n4.nabble.com/Mono-for-El-Capitan-OS-X-10-11-preview-package-now-available-td4666401.html

politas commented 8 years ago

Ref #1840

netkan-bot commented 8 years ago

Hey there! I'm a fun-loving automated bot who's responsible for making sure old support tickets get closed out. As we haven't seen any activity on this ticket for a while, we're hoping the problem has been resolved and I'm closing out the ticket automaically. If I'm doing this in error, please add a comment to this ticket to let us know, and we'll re-open it!

fizker commented 8 years ago

I currently have the same issue, with the same version of OS X (10.11.6 (15G31)) and CKAN (v1.18.1-0-g0d2c4f0). The issue exists in both Mono 4.2.1 (from the link in your OS X install guide) and 4.4.2 (latest version from http://www.mono-project.com)

Output from mono --version:

100ideas commented 7 years ago

Me too. Here're the last few lines of output from mono 4.2.1 (32-bit) in verbose mode, after which it appears to hang:

converting method System.Windows.Forms.FormCollection:Remove (System.Windows.Forms.Form)
Method System.Windows.Forms.FormCollection:Remove (System.Windows.Forms.Form) emitted at 0x969f300 to 0x969f328 (code length 40) [ckan.exe]
^CāŽ

And from mono 4.6.0 (32-bit) in verbose mode:

converting method void System.Windows.Forms.FormCollection:Remove (System.Windows.Forms.Form)
Method void System.Windows.Forms.FormCollection:Remove (System.Windows.Forms.Form) emitted at 0x93eb450 to 0x93eb478 (code length 40) [ckan.exe] with opts peephole,branch,inline,cfold,consprop,copyprop,deadce,linears,cmov,intrins,loop,fcmov,aot,exception,sse2,gshared,simd,alias-analysis
^CāŽ

And here's some exceptions reported by mono (more info here):

$ mono --trace=N:nothing ckan.exe gui -v 

251 [1] INFO CKAN.CmdLine.MainClass (null) - Verbose logging enabled
[0xa3878000:] EXCEPTION handling: System.UnauthorizedAccessException: Access to the path "/Library/Frameworks/Mono.framework/Versions/4.6.0/etc/mono/registry/last-btime" is denied.
[0xa3878000:] EXCEPTION handling: System.IO.FileNotFoundException: Could not load file or assembly 'UIAutomationWinforms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f4ceacb585d99812' or one of its dependencies
550 [1] INFO CKAN.Main (null) - Starting the GUI
[0xa3878000:] EXCEPTION handling: System.IO.FileNotFoundException: Could not load file or assembly 'ckan.XmlSerializers' or one of its dependencies
[0xa3878000:] EXCEPTION handling: System.IO.FileNotFoundException: Could not find file "/Users/100ideas/.mono/mwf_config".
[0xa3878000:] EXCEPTION handling: System.IO.FileNotFoundException: Could not find file "/Users/100ideas/.mono/mwf_config".
100ideas commented 7 years ago

Made some progress tracking down this bug.

Something is wrong with the way the auto-update config option or dialog window works in GUI/Main.cs#L289. The ckan application loads as expected when the if (!configuration.CheckForUpdatesOnLaunchNoNag) condition statement is skipped:

//if (!configuration.CheckForUpdatesOnLaunchNoNag)
if (false)
{
    log.Debug("Asking user if they wish for autoupdates");
    if (new AskUserForAutoUpdatesDialog().ShowDialog() == DialogResult.OK)
    {
        configuration.CheckForUpdatesOnLaunch = true;
    }

    configuration.CheckForUpdatesOnLaunchNoNag = true;
    configuration.Save();
}

I haven't had time to figure out the deeper cause of the problem, will be back if I have time later.

Ping #1501

politas commented 7 years ago

Reopening due to progress. Thanks for looking into this for us, @100ideas!

100ideas commented 7 years ago

I haven't had time to explore the issue further, sorry guys! I could submit a PR that disables the auto-update dialog window during launch if the OSX is detected... otherwise I might have time to look further in a week or two.

rgioai commented 7 years ago

Thanks @100ideas for the fix, worked great for me. I'll leave my fork open with the fix for anyone that wants it: https://github.com/gioGats/CKAN/

huslage commented 7 years ago

@gioGats can you submit a PR here?

ayan4m1 commented 7 years ago

Sorry, I took a look at this commit and while I am sure we can use it to fix the problem properly, if (false) doesn't make too much sense and likely has unintended side effects. Thanks @gioGats for writing it up! I will take this over, but your Macs will have to serve as my testbed unless one of the other devs happens to have one. My quick search tells me I can't legally buy OS X and run it in a virtualization environment, so šŸ­.

ayan4m1 commented 7 years ago

Initial results - that form is the only place we used FormBorderStyle.FixedToolWindow - guess what has issues related to Mono on Macs...?

There are still plenty of other potential causes, but my current hypothesis is https://github.com/ayan4m1/CKAN/commit/4c0cf379b4eafa2a44a1cfcca167b4c5c00170f8

huslage commented 7 years ago

Happy to help test. On Tue, Nov 1, 2016 at 10:06 PM ayan4m1 notifications@github.com wrote:

Initial results - that form is the only place we used FormBorderStyle.FixedToolWindow - guess what has issues http://stackoverflow.com/questions/8593379/why-does-showdialog-crash-in-monodevelop related to Mono on Macs...?

ayan4m1@4c0cf37 https://github.com/ayan4m1/CKAN/commit/4c0cf379b4eafa2a44a1cfcca167b4c5c00170f8

ā€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KSP-CKAN/CKAN/issues/1844#issuecomment-257752688, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZQq3tCLAl1UGCklLy6TyWmMbUHiK90ks5q5_ArgaJpZM4JWcsh .

100ideas commented 7 years ago

me too

Sparkly-Panda commented 7 years ago

I found that running ckan, even without the gui, and opening kip thru steam still applies the mods but you can't change them

politas commented 7 years ago

If any MacOS users would like to join the CKAN project as in-house MacOS CKAN testers, I'd be very happy to have a MacOS-testers group we can ping

ProfFan commented 7 years ago

+1 for MacOS Tester

politas commented 7 years ago

Thanks, @ProfFan , I've sent you an invite. @huslage, @100ideas, would you like invites, too?

leo-hotto-ko commented 7 years ago

hello, i've been stuck for days impossible to lauch the Ckan GUI after try everything i must have miss something i beg for help i can't play my favorite game and after a day of hardwork it's frustrating for a newbie like me to dive in terminal and mono problems that where i don't understand shit ... i never had a problem like this before, since el capitain it's driving me mad

leo-hotto-ko commented 7 years ago

Last login: Fri Jan 6 14:54:30 on ttys000 iMac-de-marion:~ marion$ cd downloads iMac-de-marion:downloads marion$ mono ckan.exe WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all exception inside UnhandledException handler: Object reference not set to an instance of an object

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.ThemeEngine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.ThemeWin32Classic' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.KnownColors' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x000cc] in <1917aa1c39d94b1a91807b8cd9f03350>:0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x0001a] in <1917aa1c39d94b1a91807b8cd9f03350>:0 --- End of inner exception stack trace --- at System.Drawing.Color.get_Black () [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x0002d] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x000ea] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00014] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 at System.Windows.Forms.Form..ctor () [0x00012] in :0 at CKAN.Main..ctor (System.String[] cmdlineArgs, CKAN.GUIUser user, System.Boolean showConsole) [0x00024] in :0 at (wrapper remoting-invoke-with-check) CKAN.Main:.ctor (string[],CKAN.GUIUser,bool) at CKAN.GUI.Main (System.String[] args, System.Boolean showConsole) [0x00057] in :0 at CKAN.CmdLine.MainClass.Gui (CKAN.CmdLine.GuiOptions options, System.String[] args) [0x00008] in :0 at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x000a1] in :0 iMac-de-marion:downloads marion$

rwanyoike commented 7 years ago

@leo-hotto-ko maybe this will help:

I'm running macOS Sierra 10.12.2. All I did was run:

$ brew cask install mono-mdk

in the terminal, and ckan.exe works. What is brew? See http://brew.sh/ and https://caskroom.github.io/. It's simple to setup, give it a shot. Good luck!

For reference, I have this version of mono-mdk:

$ brew cask info mono-mdk
mono-mdk: 4.6.2.16

And ckan.exe:

$ mono ckan.exe version
v1.20.1-0-gd41fe54 (beta)
leo-hotto-ko commented 7 years ago

thank you for u'r quick awser i try that right away, sorry for my english not my native language ^^

leo-hotto-ko commented 7 years ago

Ok i install homebrew via terminal. Do i need to unistall my previous version of mono (4.6.1) it's a little bit advance for me one or two command line would help --"

leo-hotto-ko commented 7 years ago

and i don't understand the "cask" thing ..

rwanyoike commented 7 years ago

Yes uninstall your previous version of mono (4.6.1) http://www.mono-project.com/docs/about-mono/supported-platforms/osx/#uninstalling-mono-on-mac-os-x.

This is an example of what you'd run:

Install brew (from http://brew.sh/):

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install brew cask (from https://caskroom.github.io/):

$ brew tap caskroom/cask

Install mono-mdk

$ brew cask install mono-mdk

šŸ»

leo-hotto-ko commented 7 years ago

ok guys u are indeed quite amazing ^^ all look to be install, do i need a different comand line for running ckan.exe ? ( cd Downloads mono ckan.exe) ?

leo-hotto-ko commented 7 years ago

i'm afraid to try anything now XD rwanyoike u rule boy a big TY for u'r precious help

rwanyoike commented 7 years ago

@leo-hotto-ko no different command. https://github.com/KSP-CKAN/CKAN/wiki/Installing-CKAN-on-OSX:

$ cd ~/Downloads
$ mono ckan.exe
leo-hotto-ko commented 7 years ago

arg still the same --"

WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all exception inside UnhandledException handler: Object reference not set to an instance of an object

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.ThemeEngine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.ThemeWin32Classic' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.KnownColors' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.dylib at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) at System.Drawing.GDIPlus..cctor () [0x000cc] in <1917aa1c39d94b1a91807b8cd9f03350>:0 --- End of inner exception stack trace --- at System.Drawing.KnownColors..cctor () [0x0001a] in <1917aa1c39d94b1a91807b8cd9f03350>:0 --- End of inner exception stack trace --- at System.Drawing.Color.get_Black () [0x00000] in <1917aa1c39d94b1a91807b8cd9f03350>:0 at System.Windows.Forms.ThemeWin32Classic..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.ThemeVisualStyles..ctor () [0x00000] in :0 at System.Windows.Forms.ThemeEngine..cctor () [0x0002d] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.SystemInformation.getMenuAccessKeysUnderlined () [0x00000] in :0 at System.Windows.Forms.Control..ctor () [0x000ea] in :0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor () at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at System.Windows.Forms.Control..ctor () [0x00014] in :0 at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in :0 at System.Windows.Forms.ContainerControl..ctor () [0x0000e] in :0 at System.Windows.Forms.Form..ctor () [0x00012] in :0 at CKAN.Main..ctor (System.String[] cmdlineArgs, CKAN.GUIUser user, System.Boolean showConsole) [0x00024] in :0 at (wrapper remoting-invoke-with-check) CKAN.Main:.ctor (string[],CKAN.GUIUser,bool) at CKAN.GUI.Main (System.String[] args, System.Boolean showConsole) [0x00057] in :0 at CKAN.CmdLine.MainClass.Gui (CKAN.CmdLine.GuiOptions options, System.String[] args) [0x00008] in :0 at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x000a1] in :0 iMac-de-marion:Downloads marion$

rwanyoike commented 7 years ago

@leo-hotto-ko what does this command show for you:

$ mono --version

And you have the latest ckan.exe?

leo-hotto-ko commented 7 years ago

Last login: Fri Jan 6 15:38:18 on ttys000 iMac-de-marion:~ marion$ mono --version Mono JIT compiler version 4.6.2 (Stable 4.6.2.7/08fd525 Tue Nov 22 22:05:58 GMT 2016) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: normal SIGSEGV: altstack Notification: kqueue Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen iMac-de-marion:~ marion$

Ckan V1.22.1 latest i think

rwanyoike commented 7 years ago

@leo-hotto-ko can you visit https://tlk.io/mono

100ideas commented 7 years ago

@politas pleased to help out w/ mac dev testing

politas commented 7 years ago

@100ideas , I've sent you an invite. Thanks!

mnewt commented 7 years ago

@politas If you still need macOS testers, I'm willing and able depending on what you want a tester to do. I don't know C# but I do IT and development professionally so I can do QA.

Currently experiencing this issue. That is, ckan command line functions work fine but the gui crashes with an exception in System.Windows.Forms.WindowsFormsSynchronizationContext. Cheers.

AdamLenda commented 7 years ago

rwanyoike comment on Jan 6 worked for me, though I did have to remove all versions of CKan and then rerun brew install ckan

ayan4m1 commented 6 years ago

I am fairly confident that this long issue history is actually multiple different problems manifesting in the same way. I think they can all be traced back to Mono or OS X and not to a defect in CKAN. @politas mind chiming in? I know multiple people have offered to help with testing but I am not sure what to give them to test.

politas commented 6 years ago

Yeah, lets close this off with a request for anyone still having problems to check the CKAN on OSX page and open a new issue if problems still occur.