KSP-CKAN / CKAN

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

Error: SecureChannelFailure (The authentication or decryption has failed.) #2307

Closed Whovian41110 closed 6 years ago

Whovian41110 commented 6 years ago

Background

CKAN Version: 1.24.0

KSP Version: 1.3.1

Operating System: OSX High Sierra Version 10.13.3

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? Yes but irrelevant

Problem

What steps did you take in CKAN?

I opened it

I attempted to install Roverdude's Orion Drive mod and USI tools.

What did you expect to happen? I expected the mod to download properly.

What happened instead? It did not download due to an SSL error

, an error saying Error in auto-updating Error: SecureChannelFailure (The authentication or decryption has failed.) popped up, and I clicked dismiss. The application opened normally.

When it downloaded it failed due to "Oh no! Our download failed with a certificate error!" then pointed me towards the wiki page on SSL errors that was not helpfu

Screenshots: Unnecessary

CKAN error codes (if applicable):

HebaruSan commented 6 years ago

Was there any additional information in the popup, such as a stack trace?

Whovian41110 commented 6 years ago

The first popup? No. The error log also didn’t have any

HebaruSan commented 6 years ago

And you tried all of the steps on the wiki, including running cert-sync?

Whovian41110 commented 6 years ago

how do i run that on a mac?

HebaruSan commented 6 years ago

Presumably from Terminal, but I don't have one to test. OSX uses Mono just like Linux, so some variant of those commands might help.

HebaruSan commented 6 years ago

Further questions:

Whovian41110 commented 6 years ago

Previous release worked before the meltdown. I use the CKAN.app I have mono 4.8 because anything higher throws the carbon 64bit error

HebaruSan commented 6 years ago

Looks like that version of Mono requires an environment variable to be set to allow TLS 1.2:

http://www.mono-project.com/docs/about-mono/releases/4.8.0/

TLS 1.2 Support Mono now ships with TLS 1.2, powered by Google’s BoringSSL project. (*)

To use it, you must set the environment variable MONO_TLS_PROVIDER to the value “btls”, like this:

export MONO_TLS_PROVIDER=btls

Can you try that?

Whovian41110 commented 6 years ago

Nope. Did nothing

HebaruSan commented 6 years ago

OK, you might have to try Mono 5. We have reports of this problem being solved on Linux by upgrading Mono. If you explain what you mean by the carbon 64bit error, maybe we can solve it or work around it.

cherrydev commented 6 years ago

I'm getting this on Windows too with version 1.24.0-PRE. This is almost certainly due to GitHub removing support for LTSv1/TLSv1.1, diffie-hellman-group1-sha and diffie-hellman-group14-sha1 since these parts of ssl are considered insecure.

https://github.com/blog/2507

HebaruSan commented 6 years ago

Yup, see #2293, install https://github.com/KSP-CKAN/CKAN/releases/latest

Whovian41110 commented 6 years ago

so @HebaruSan Should I nake a new issue or no? (for Mono v5)

Whovian41110 commented 6 years ago

Here is the error that is created when I run CKAN with Mono 5 latest ver.

Click to expand BLEEPs-MacBook-Pro:~ BLEEP$ cd "$(mdfind ckan.app)" BLEEPs-MacBook-Pro:CKAN.app BLEEP$ mono Contents/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 Stacktrace: at <0xffffffff> at (wrapper managed-to-native) System.Windows.Forms.XplatUICarbon.CGDisplayBounds (intptr) [0x00002] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.XplatUICarbon.get_WorkingArea () [0x00005] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.XplatUICarbon.get_VirtualScreen () [0x00000] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.XplatUI.get_VirtualScreen () [0x00000] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.Screen..cctor () [0x00034] in <1141838629e74c21a3b96d0a06337bad>:0 at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) [0x0001e] in :0 at <0xffffffff> at System.Windows.Forms.Form.get_CreateParams () [0x00157] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.CommonDialog/DialogForm.get_CreateParams () [0x00000] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.Form.SetClientSizeCore (int,int) [0x000af] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.Control.set_ClientSize (System.Drawing.Size) [0x0000f] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.Form.set_ClientSize (System.Drawing.Size) [0x00007] in <1141838629e74c21a3b96d0a06337bad>:0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form.set_ClientSize (System.Drawing.Size) [0x00032] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.FileDialog..ctor () [0x00954] in <1141838629e74c21a3b96d0a06337bad>:0 at System.Windows.Forms.OpenFileDialog..ctor () [0x00000] in <1141838629e74c21a3b96d0a06337bad>:0 at (wrapper remoting-invoke-with-check) System.Windows.Forms.OpenFileDialog..ctor () [0x00018] in <1141838629e74c21a3b96d0a06337bad>:0 at CKAN.PluginsDialog..ctor () [0x00000] in <74d9e06aaf404eea9cd8286643721e98>:0 at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004d] in :0 at <0xffffffff> at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) [0x0000c] in :0 at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) [0x00002] in :0 at System.RuntimeType.CreateInstanceMono (bool) [0x000a8] in :0 at System.RuntimeType.CreateInstanceSlow (bool,bool,bool,System.Threading.StackCrawlMark&) [0x00009] in :0 at System.RuntimeType.CreateInstanceDefaultCtor (bool,bool,bool,System.Threading.StackCrawlMark&) [0x00027] in :0 at System.Activator.CreateInstance () [0x00015] in :0 at CKAN.ControlFactory.CreateControl () [0x00017] in <74d9e06aaf404eea9cd8286643721e98>:0 at CKAN.Main.RecreateDialogs () [0x00022] in <74d9e06aaf404eea9cd8286643721e98>:0 at CKAN.Main..ctor (string[],CKAN.GUIUser,bool) [0x001f5] in <74d9e06aaf404eea9cd8286643721e98>:0 at (wrapper remoting-invoke-with-check) CKAN.Main..ctor (string[],CKAN.GUIUser,bool) [0x0001b] in <74d9e06aaf404eea9cd8286643721e98>:0 at CKAN.GUI.Main_ (string[],bool) [0x0003b] in <74d9e06aaf404eea9cd8286643721e98>:0 at CKAN.CmdLine.MainClass.Gui (CKAN.CmdLine.GuiOptions,string[]) [0x00007] in <74d9e06aaf404eea9cd8286643721e98>:0 at CKAN.CmdLine.MainClass.Main (string[]) [0x000a0] in <74d9e06aaf404eea9cd8286643721e98>:0 at (wrapper runtime-invoke) .runtime_invoke_int_object (object,intptr,intptr,intptr) [0x00054] in <74d9e06aaf404eea9cd8286643721e98>:0 Native stacktrace: 0 mono 0x0000000107f6dc01 mono_handle_native_crash + 257 1 mono 0x0000000107fd8236 altstack_handle_and_restore + 70 2 SkyLight 0x00007fff6754ffa8 SLDisplayBounds + 83 3 ??? 0x000000011643a2ee 0x0 + 4668498670 4 ??? 0x00000001087473c6 0x0 + 4436816838 5 mono 0x0000000107ec44c7 mono_jit_runtime_invoke + 1383 6 mono 0x0000000108084ed4 do_runtime_invoke + 84 7 mono 0x0000000108081024 mono_runtime_class_init_full + 996 8 mono 0x0000000107ebd7ce mono_jit_compile_method_inner + 2478 9 mono 0x0000000107ec0683 mono_jit_compile_method_with_opt + 1363 10 mono 0x0000000107f700c1 common_call_trampoline + 1217 11 mono 0x0000000107f6fbbc mono_magic_trampoline + 60 12 ??? 0x000000010838739e 0x0 + 4432884638 13 ??? 0x000000010f93473b 0x0 + 4556277563 14 ??? 0x00000001127efe4b 0x0 + 4605279819 15 ??? 0x00000001127ec06b 0x0 + 4605263979 16 mono 0x0000000107ec44c7 mono_jit_runtime_invoke + 1383 17 mono 0x0000000108084ed4 do_runtime_invoke + 84 18 mono 0x0000000108088d1b mono_runtime_try_invoke_array + 1851 19 mono 0x000000010802bb87 ves_icall_InternalInvoke + 647 20 ??? 0x00000001084a1901 0x0 + 4434041089 21 mscorlib.dll.dylib 0x000000010a6ebdc3 System_RuntimeType_CreateInstanceMono_bool + 275 22 ??? 0x000000010874fe03 0x0 + 4436852227 23 ??? 0x000000010872b96d 0x0 + 4436703597 24 mono 0x0000000107ec44c7 mono_jit_runtime_invoke + 1383 25 mono 0x0000000108084ed4 do_runtime_invoke + 84 26 mono 0x00000001080884f9 do_exec_main_checked + 137 27 mono 0x0000000107f314bf mono_jit_exec + 287 28 mono 0x0000000107f33cb4 mono_main + 9140 29 mono 0x0000000107eb3e8d main + 253 30 mono 0x0000000107eb3d84 start + 52 31 ??? 0x0000000000000002 0x0 + 2 Debug info from gdb: (lldb) command source -s 0 '/tmp/mono-gdb-commands.WVDuks' Executing commands in '/tmp/mono-gdb-commands.WVDuks'. (lldb) process attach --pid 58070 warning: (x86_64) /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/4.5/mscorlib.dll.dylib empty dSYM file detected, dSYM was created with an executable with no debug info. warning: (x86_64) /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/libglib-2.0.0.dylib empty dSYM file detected, dSYM was created with an executable with no debug info. Process 58070 stopped * thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP frame #0: 0x00007fff6d4f0502 libsystem_kernel.dylib`__wait4 + 10 libsystem_kernel.dylib`__wait4: -> 0x7fff6d4f0502 <+10>: jae 0x7fff6d4f050c ; <+20> 0x7fff6d4f0504 <+12>: movq %rax, %rdi 0x7fff6d4f0507 <+15>: jmp 0x7fff6d4e70dd ; cerror 0x7fff6d4f050c <+20>: retq Target 0: (mono) stopped. Executable module set to "/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono". Architecture set to: x86_64h-apple-macosx. (lldb) thread list Process 58070 stopped * thread #1: tid = 0x987894, 0x00007fff6d4f0502 libsystem_kernel.dylib`__wait4 + 10, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP thread #2: tid = 0x987895, 0x00007fff6d4efcee libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'SGen worker' thread #3: tid = 0x9878b7, 0x00007fff6d4e67fe libsystem_kernel.dylib`semaphore_wait_trap + 10, name = 'Finalizer' thread #4: tid = 0x9878d0, 0x00007fff6d4f0562 libsystem_kernel.dylib`__workq_kernreturn + 10 thread #5: tid = 0x9878d1, 0x00007fff6d4f0562 libsystem_kernel.dylib`__workq_kernreturn + 10 thread #6: tid = 0x9878d4, 0x00007fff6d4f0562 libsystem_kernel.dylib`__workq_kernreturn + 10 thread #7: tid = 0x9878de, 0x00007fff6d4f0ec2 libsystem_kernel.dylib`kevent + 10, name = 'tid_5603' thread #8: tid = 0x9878df, 0x00007fff6d4f0ec2 libsystem_kernel.dylib`kevent + 10, name = 'tid_a603' thread #9: tid = 0x9878e0, 0x00007fff6d4efcee libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Timer-Scheduler' (lldb) thread backtrace all * thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00007fff6d4f0502 libsystem_kernel.dylib`__wait4 + 10 frame #1: 0x0000000107f6dc8e mono`mono_handle_native_crash(signal=, ctx=, info=) at mini-exceptions.c:2731 [opt] frame #2: 0x0000000107fd8236 mono`altstack_handle_and_restore(ctx=0x00007ffee7d4cb40, obj=0x0000000000000000, stack_ovf=0) at exceptions-amd64.c:856 [opt] frame #3: 0x00007fff6754ffa8 SkyLight`SLDisplayBounds + 83 frame #4: 0x000000011643a2ee frame #5: 0x00000001087473c6 frame #6: 0x0000000107ec44c7 mono`mono_jit_runtime_invoke(method=, obj=, params=0x0000000000000000, exc=0x0000000116439c70, error=) at mini-runtime.c:2800 [opt] frame #7: 0x0000000108084ed4 mono`do_runtime_invoke(method=0x00007fa1b4a4ebc0, obj=0x0000000000000000, params=0x0000000000000000, exc=0x00007ffee7d4d238, error=0x00007ffee7d4d410) at object.c:2849 [opt] frame #8: 0x0000000108081024 mono`mono_runtime_class_init_full [inlined] mono_runtime_try_invoke(method=, obj=, params=, error=0x00007ffee7d4d410) at object.c:2956 [opt] frame #9: 0x0000000108080fdf mono`mono_runtime_class_init_full(vtable=0x00007fa1b4e93d08, error=0x00007ffee7d4d410) at object.c:473 [opt] frame #10: 0x0000000107ebd7ce mono`mono_jit_compile_method_inner(method=0x00007fa1b4a4ea48, target_domain=, opt=, error=0x00007ffee7d4d410) at mini.c:4343 [opt] frame #11: 0x0000000107ec0683 mono`mono_jit_compile_method_with_opt(method=0x00007fa1b4a4ea48, opt=, jit_only=0, error=) at mini-runtime.c:2129 [opt] frame #12: 0x0000000107f700c1 mono`common_call_trampoline(regs=0x00007ffee7d4d4d8, code="H\x8b?H??\xa8H\x8b??8, m=0x00007fa1b4a4ea48, vt=, vtable_slot=, error=) at mini-trampolines.c:715 [opt] frame #13: 0x0000000107f6fbbc mono`mono_magic_trampoline(regs=0x00007ffee7d4d4d8, code="H\x8b?H??\xa8H\x8b??8, arg=0x00007fa1b4a4ea48, tramp=) at mini-trampolines.c:846 [opt] frame #14: 0x000000010838739e frame #15: 0x000000010f93473b frame #16: 0x00000001127efe4b frame #17: 0x00000001127ec06b frame #18: 0x0000000107ec44c7 mono`mono_jit_runtime_invoke(method=, obj=, params=0x0000000000000000, exc=0x0000000108910bf8, error=) at mini-runtime.c:2800 [opt] frame #19: 0x0000000108084ed4 mono`do_runtime_invoke(method=0x00007fa1b4df40b8, obj=0x00000001088c3a80, params=0x0000000000000000, exc=0x0000000000000000, error=0x00007ffee7d4e010) at object.c:2849 [opt] frame #20: 0x0000000108088d1b mono`mono_runtime_try_invoke_array [inlined] mono_runtime_invoke_checked(error=) at object.c:3002 [opt] frame #21: 0x0000000108088ce2 mono`mono_runtime_try_invoke_array(method=, obj=, params=0x0000000000000000, exc=0x0000000000000000, error=0x00007ffee7d4e010) at object.c:5145 [opt] frame #22: 0x000000010802bb87 mono`ves_icall_InternalInvoke(method=, this_arg=, params=0x0000000000000000, exc=0x00007ffee7d4e170) at icall.c:3367 [opt] frame #23: 0x00000001084a1901 frame #24: 0x000000010a6ebdc3 mscorlib.dll.dylib`System_RuntimeType_CreateInstanceMono_bool + 275 frame #25: 0x000000010a6ebc9c mscorlib.dll.dylib`System_RuntimeType_CreateInstanceSlow_bool_bool_bool_System_Threading_StackCrawlMark_ + 60 frame #26: 0x000000010a6eb77d mscorlib.dll.dylib`System_RuntimeType_CreateInstanceDefaultCtor_bool_bool_bool_System_Threading_StackCrawlMark_ + 93 frame #27: 0x000000010a69ac3f mscorlib.dll.dylib`System_Activator_CreateInstance_T_REF + 143 frame #28: 0x000000010fdce31b frame #29: 0x000000010874fe03 frame #30: 0x000000010872b96d frame #31: 0x0000000107ec44c7 mono`mono_jit_runtime_invoke(method=, obj=, params=0x00007ffee7d4e738, exc=0x00007ffee7d4e170, error=) at mini-runtime.c:2800 [opt] frame #32: 0x0000000108084ed4 mono`do_runtime_invoke(method=0x00007fa1b34025c8, obj=0x0000000000000000, params=0x00007ffee7d4e738, exc=0x0000000000000000, error=0x00007ffee7d4e778) at object.c:2849 [opt] frame #33: 0x00000001080884f9 mono`do_exec_main_checked [inlined] mono_runtime_invoke_checked(method=, obj=, error=) at object.c:3002 [opt] frame #34: 0x00000001080884b8 mono`do_exec_main_checked(method=0x00007fa1b34025c8, args=, error=0x00007ffee7d4e778) at object.c:4726 [opt] frame #35: 0x0000000107f314bf mono`mono_jit_exec(domain=, assembly=, argc=1, argv=0x00007ffee7d4ea98) at driver.g.c:1040 [opt] frame #36: 0x0000000107f33cb4 mono`mono_main [inlined] main_thread_handler at driver.g.c:1109 [opt] frame #37: 0x0000000107f33c81 mono`mono_main(argc=2, argv=) at driver.g.c:2222 [opt] frame #38: 0x0000000107eb3e8d mono`main [inlined] mono_main_with_options(argc=, argv=) at main.c:46 [opt] frame #39: 0x0000000107eb3e79 mono`main(argc=2, argv=) at main.c:339 [opt] frame #40: 0x0000000107eb3d84 mono`start + 52 thread #2, name = 'SGen worker' frame #0: 0x00007fff6d4efcee libsystem_kernel.dylib`__psynch_cvwait + 10 frame #1: 0x00007fff6d62c662 libsystem_pthread.dylib`_pthread_cond_wait + 732 frame #2: 0x000000010813dc9e mono`thread_func [inlined] mono_os_cond_wait(mutex=) at mono-os-mutex.h:173 [opt] frame #3: 0x000000010813dc8b mono`thread_func at sgen-thread-pool.c:165 [opt] frame #4: 0x000000010813dc7d mono`thread_func(data=0x0000000000000000) at sgen-thread-pool.c:196 [opt] frame #5: 0x00007fff6d62b6c1 libsystem_pthread.dylib`_pthread_body + 340 frame #6: 0x00007fff6d62b56d libsystem_pthread.dylib`_pthread_start + 377 frame #7: 0x00007fff6d62ac5d libsystem_pthread.dylib`thread_start + 13 thread #3, name = 'Finalizer' frame #0: 0x00007fff6d4e67fe libsystem_kernel.dylib`semaphore_wait_trap + 10 frame #1: 0x00000001080ea41c mono`finalizer_thread [inlined] mono_os_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) at mono-os-semaphore.h:90 [opt] frame #2: 0x00000001080ea411 mono`finalizer_thread at mono-coop-semaphore.h:43 [opt] frame #3: 0x00000001080ea405 mono`finalizer_thread(unused=) at gc.c:866 [opt] frame #4: 0x00000001080a66d0 mono`start_wrapper [inlined] start_wrapper_internal at threads.c:1003 [opt] frame #5: 0x00000001080a6633 mono`start_wrapper(data=) at threads.c:1063 [opt] frame #6: 0x00007fff6d62b6c1 libsystem_pthread.dylib`_pthread_body + 340 frame #7: 0x00007fff6d62b56d libsystem_pthread.dylib`_pthread_start + 377 frame #8: 0x00007fff6d62ac5d libsystem_pthread.dylib`thread_start + 13 thread #4 frame #0: 0x00007fff6d62ac40 libsystem_pthread.dylib`start_wqthread thread #5 frame #0: 0x00007fff6d4f0562 libsystem_kernel.dylib`__workq_kernreturn + 10 frame #1: 0x00007fff6d62b26f libsystem_pthread.dylib`_pthread_wqthread + 1552 frame #2: 0x00007fff6d62ac4d libsystem_pthread.dylib`start_wqthread + 13 thread #6 frame #0: 0x00007fff6d4f0562 libsystem_kernel.dylib`__workq_kernreturn + 10 frame #1: 0x00007fff6d62b06a libsystem_pthread.dylib`_pthread_wqthread + 1035 frame #2: 0x00007fff6d62ac4d libsystem_pthread.dylib`start_wqthread + 13 thread #7, name = 'tid_5603' frame #0: 0x00007fff6d4f0ec2 libsystem_kernel.dylib`kevent + 10 frame #1: 0x0000000108024220 mono`ves_icall_System_IO_KqueueMonitor_kevent_notimeout(kq_ptr=0x0000000108a2ff34, changelist=0x00007fa1b34807a0, nchanges=0, eventlist=0x00007fa1b583cc00, nevents=32) at filewatcher.c:244 [opt] frame #2: 0x000000010ff0483c thread #8, name = 'tid_a603' frame #0: 0x00007fff6d4f0ec2 libsystem_kernel.dylib`kevent + 10 frame #1: 0x0000000108024220 mono`ves_icall_System_IO_KqueueMonitor_kevent_notimeout(kq_ptr=0x0000000108a357b4, changelist=0x00007fa1b3799510, nchanges=0, eventlist=0x00007fa1b5067200, nevents=32) at filewatcher.c:244 [opt] frame #2: 0x000000010ff0483c thread #9, name = 'Timer-Scheduler' frame #0: 0x00007fff6d4efcee libsystem_kernel.dylib`__psynch_cvwait + 10 frame #1: 0x00007fff6d62c69b libsystem_pthread.dylib`_pthread_cond_wait + 789 frame #2: 0x00000001081495d4 mono`mono_os_cond_timedwait(cond=0x00007fa1b3805890, mutex=0x00007fa1b3805850, timeout_ms=2999) at mono-os-mutex.c:44 [opt] frame #3: 0x00000001080c7884 mono`mono_w32handle_timedwait_signal_handle [inlined] mono_w32handle_timedwait_signal_naked(cond=, mutex=, timeout=2999, poll=0, alerted=) at w32handle.c:871 [opt] frame #4: 0x00000001080c787c mono`mono_w32handle_timedwait_signal_handle(handle=, timeout=, poll=0, alerted=) at w32handle.c:988 [opt] frame #5: 0x00000001080c76a0 mono`mono_w32handle_wait_one(handle=0x0000000000000008, timeout=2999, alertable=) at w32handle.c:1109 [opt] frame #6: 0x00000001080c79b6 mono`mono_w32handle_wait_multiple(handles=, nhandles=, waitall=, timeout=, alertable=) at w32handle.c:1145 [opt] frame #7: 0x00000001080a1c64 mono`ves_icall_System_Threading_WaitHandle_Wait_internal(handles=, numhandles=, waitall=, timeout=-1, error=0x000070000353b7a8) at threads.c:1930 [opt] frame #8: 0x000000010fdfebfd frame #9: 0x000000010a83bdd0 mscorlib.dll.dylib`System_Threading_WaitHandle_InternalWaitOne_System_Runtime_InteropServices_SafeHandle_long_bool_bool + 64 frame #10: 0x000000010a83bd7c mscorlib.dll.dylib`System_Threading_WaitHandle_WaitOne_long_bool + 44 frame #11: 0x000000010a83bbe3 mscorlib.dll.dylib`System_Threading_WaitHandle_WaitOne_int_bool + 51 frame #12: 0x000000010a83bd0c mscorlib.dll.dylib`System_Threading_WaitHandle_WaitOne_int + 28 frame #13: 0x000000010a842cef mscorlib.dll.dylib`System_Threading_Timer_Scheduler_SchedulerThread + 2495 frame #14: 0x000000010a834b77 mscorlib.dll.dylib`System_Threading_ThreadHelper_ThreadStart_Context_object + 151 frame #15: 0x000000010a8327b1 mscorlib.dll.dylib`System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool + 33 frame #16: 0x000000010a832740 mscorlib.dll.dylib`System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object + 80 frame #17: 0x000000010a834cbf mscorlib.dll.dylib`System_Threading_ThreadHelper_ThreadStart + 47 frame #18: 0x00000001086caae9 frame #19: 0x0000000107ec44c7 mono`mono_jit_runtime_invoke(method=, obj=, params=0x000070000353bea8, exc=0x0000000108a3dc90, error=) at mini-runtime.c:2800 [opt] frame #20: 0x0000000108084ed4 mono`do_runtime_invoke(method=0x00007fa1b5a54350, obj=0x0000000108a3dd78, params=0x000070000353bea8, exc=0x0000000000000000, error=0x000070000353be40) at object.c:2849 [opt] frame #21: 0x00000001080a66fb mono`start_wrapper at threads.c:1011 [opt] frame #22: 0x00000001080a6633 mono`start_wrapper(data=) at threads.c:1063 [opt] frame #23: 0x00007fff6d62b6c1 libsystem_pthread.dylib`_pthread_body + 340 frame #24: 0x00007fff6d62b56d libsystem_pthread.dylib`_pthread_start + 377 frame #25: 0x00007fff6d62ac5d libsystem_pthread.dylib`thread_start + 13 (lldb) detach ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Process 58070 detached (lldb) quit Abort trap: 6
HebaruSan commented 6 years ago

No, there's no need for a new issue.

Can you try it with mono --arch=32? As far as I know, it just defaults to 64 bits, but 32 bits is still available for a WinForms app. This is already in the .app bundle.

Whovian41110 commented 6 years ago

How would I do that with using the .app CKAN? I've never used the command line version

HebaruSan commented 6 years ago

Wait, how are you running it, and what exactly did you download, from where?

Whovian41110 commented 6 years ago

The ckan mac app https://github.com/Maxzhao1999/CKAN_app/releases. I replaced the ckan.exe in the package contents with the new version

HebaruSan commented 6 years ago

OK, do not do that. Use the Mac version on the main download page. Maxzhao's version is old and unsupported.

https://github.com/KSP-CKAN/CKAN/releases/download/v1.24.0/CKAN.dmg

Whovian41110 commented 6 years ago

That just redirects to the how install on mac when I open it

HebaruSan commented 6 years ago

OK, that means it can't find mono. Can you open a terminal and type "which mono" and let me know what it says?

Whovian41110 commented 6 years ago

it says this /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono

HebaruSan commented 6 years ago

Thank you! Can you please try this test version?

Apparently the PATH variable isn't set as we thought it would be on OSX.

Whovian41110 commented 6 years ago

that strait up does nothing

HebaruSan commented 6 years ago

Nothing as in you double click and nothing at all happens, or nothing as in it does the same thing as before, launch a web page?

Whovian41110 commented 6 years ago

Nothing as in double click, the icon shows up then closes without anything appearing

HebaruSan commented 6 years ago

OK, believe it or not that indicates progress, as it's now finding Mono correctly.

I took another look at the packaging and tried to eliminate anything that looked like it might fail. Can you please try this build?

It should give you a popup with some info after it tries to run Mono, even if it works. We would remove that in the released version, but I wanted to make sure there was some feedback instead of nothing happening.

Apologies for the delays and the trial-and-error, but I don't have a Mac for testing and I'm trying to triple check everything before I send it to you.

cherrydev commented 6 years ago

For me, the previous CKAN.zip did nothing when I first started it, but the second time I ran it, everything came up perfectly.

HebaruSan commented 6 years ago

Thanks, @cherrydev. Would you mind trying the latest one as well? I think it's probably a better approach, so I'd like to confirm that it works for folks.

cherrydev commented 6 years ago

This version doesn't launch, it just exists silently. The console shows:

2018-02-25 1:04:09.589 PM lsd[337]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
2018-02-25 1:04:09.667 PM osascript[19737]: Performance: Please update this scripting addition to supply a value for ThreadSafe for each event handler: "/Library/ScriptingAdditions/MumbleOverlay.osax"
2018-02-25 1:04:09.689 PM com.apple.xpc.launchd[1]: (org.ksp-ckan.ckan.680672[19733]) Service exited with abnormal code: 1
cherrydev commented 6 years ago

P.S. If you want me to poke at the source code with a stick, I'm a developer. FYI, I'm on 10.11.6 and my /Library/Frameworks/Mono.framework/Versions/ looks like:

drwxrwxrwx+ 12 root  admin  408 10 Mar  2010 2.6.3
drwxr-xr-x  12 root  admin  408 12 Oct  2015 3.12.1
drwxr-xr-x  10 root  admin  340 10 Nov  2015 4.2.1
drwxr-xr-x  10 root  admin  340  3 Mar  2016 4.2.3
drwxr-xr-x  12 root  admin  408  6 May  2017 5.0.0
lrwxr-xr-x   1 root  admin   49  6 May  2017 Current -> /Library/Frameworks/Mono.framework/Versions/5.0.0
HebaruSan commented 6 years ago

@cherrydev , yeah that would be great if you have the time.

The current script is here:

https://github.com/KSP-CKAN/CKAN/blob/86bf144ec7ce7fa36b1aaddaadfff2519481fc52/macosx/CKAN#L1-L23

And you can check your copy of the bundle from the ZIP to see the changes I made for testing. All we're trying to do is launch "mono ckan.exe". But OSX is making that extremely difficult for reasons that are not clear to me.

Whovian41110 commented 6 years ago

Yeah that new version doesn't work with me

Whovian41110 commented 6 years ago

So somebody let me know once we have something. TBH this is black magic to me

cherrydev commented 6 years ago

Try this. My comments in double hashes.

# Check El Capitan's mono install location
PATH="$PATH":/usr/local/bin
export PATH

## Mono 5 uses paths.d but when launched from the Finder, a shell script starts with a restricted environment without any of your other paths set
if [ -r "/etc/paths.d/mono-commands" ]
then
                PATH="$PATH":"$(cat /etc/paths.d/mono-commands)"
                export PATH
fi
## At this point, you should have mono in your path regardless of if it was installed in /usr/bin (old Mono) /usr/local/bin (Mono 4) or using /etc/paths.d (Mono 5)
MONO=$(which mono)

if [ -z "$MONO" -o ! -x "$MONO" ]
then
        # We could not find mono. The wiki explains how to install.
        open 'https://github.com/KSP-CKAN/CKAN/wiki/Installing-CKAN-on-OSX'
else
        # Mono found, so we can run CKAN.
        ## This is simple and works fine (instead of that old weird one-liner) if we're running bash, which we now are (new /bin/bash shebang)
        APP_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
        ASSEMBLY=ckan.exe
        MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current
        export DYLD_FALLBACK_LIBRARY_PATH=$APP_PATH/Contents/MacOS:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib

        cd "$APP_PATH"
        exec -a "CKAN" "$MONO" --arch=32 $ASSEMBLY $@
fi
Whovian41110 commented 6 years ago

so how do I edit the app to add this?

cherrydev commented 6 years ago

You can right-click and "Show Package Contents" on CKAN.app, go into Contents/MacOS edit the file CKAN with a text editor and copy and paste the contents. Or you can just wait for @HebaruSan to re-package it after they test it.

Whovian41110 commented 6 years ago

And this is a replacement for the whole executable?

HebaruSan commented 6 years ago

So what's the key part of the fix? I think we already had the right path to mono in my previous ZIP since it wasn't launching a browser anymore, so I assume it's the APP_PATH logic? Why wouldn't a straight dirname cover that without running pwd in a subcommand?

cherrydev commented 6 years ago

I THINK the key part of the fix (it was for me) is that mono was actually NOT in my path without reading it from /etc/paths.d/mono-commands. With Mono 5 installed it never creates an executable in /usr/bin or /usr/local/bin (https://stackoverflow.com/a/32547884) . I don't know if the APP_PATH thing makes any difference. I changed it because I couldn't understand how the old code works, the new version seems to be a pretty standard bash idiom compared to the old one, and it doesn't require you to tack the relative path of the script from the .app wrapper into it.

Whovian41110 commented 6 years ago

So ill just wait then

cherrydev commented 6 years ago

Oh, FYI, I was comparing this to your script that had your weird APP_PATH=$(echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }') thing in it. Not the one which had a simple MACOS_PATH="$(dirname $0)" I guess now that I look at the two, they should be more-or-less functionally equivalent. I didn't figure out yet why your latest script didn't work.

HebaruSan commented 6 years ago

Thanks, the only difference I see in the two dirname statements is that yours would give an absolute path. I guess that might matter...?

EDIT: Except both scripts do the exact same thing with the output of dirname, cd into it. If mine doesn't work, yours shouldn't either. Hmm.

cherrydev commented 6 years ago

For whatever reason, yes, that actually seems to be the difference between it working and not working for me.

HebaruSan commented 6 years ago

What about the osxmessage thing in the ZIP's script? I was not happy with having no way to report error messages, but is there any hope of that actually working?

HebaruSan commented 6 years ago

OK, here's a hybrid of my previous ZIP script and @cherrydev's script above. I have added the /etc/paths.d block and the "$(cd "$(dirname "$0")" && pwd)" thing, but also kept the osxmessage error popups and added some environment variables that "macpack" uses for WinForms.

@Whovian41110 you can come back and test this now if you like, but it may or may not work yet.

cherrydev commented 6 years ago

I'm not 100% sure why the osxmessage isn't working when it fails. It's possible that when attempting to execute an invalid path the wrapper script itself is erroring out and therefore not getting to the osxmessage?

Whovian41110 commented 6 years ago

Okay guys. When i started the .app again it just worked. The secure channel just worked...

HebaruSan commented 6 years ago

Thanks, @Whovian41110. I'll start the process of getting these changes into an official release...