Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Whovian41110 opened this issue Feb 23, 2018 · 49 comments
Closed
Assignees
Labels
macOS Issues specific for macOS Mono Issues specific for Mono

Comments

@Whovian41110
Copy link

Whovian41110 commented Feb 23, 2018

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 HebaruSan added macOS Issues specific for macOS Network Issues affecting internet connections of CKAN labels Feb 23, 2018
@HebaruSan
Copy link
Member

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

@Whovian41110
Copy link
Author

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

@HebaruSan HebaruSan changed the title SSL Certification out of date and not updating Error: SecureChannelFailure (The authentication or decryption has failed.) Feb 23, 2018
@HebaruSan
Copy link
Member

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

@Whovian41110
Copy link
Author

how do i run that on a mac?

@HebaruSan
Copy link
Member

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
Copy link
Member

HebaruSan commented Feb 23, 2018

Further questions:

  • Was the previous release working for you before the big GitHub meltdown?
  • Are you running ckan.exe directly as with previous releases, or using the CKAN.dmg / CKAN.app stuff?
  • Which version of Mono do you have?

@HebaruSan HebaruSan added the Support Issues that are support requests label Feb 23, 2018
@Whovian41110
Copy link
Author

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
Copy link
Member

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?

@HebaruSan HebaruSan added the Mono Issues specific for Mono label Feb 24, 2018
@Whovian41110
Copy link
Author

Nope. Did nothing

@KSP-CKAN KSP-CKAN deleted a comment from DavidShade Feb 24, 2018
@HebaruSan
Copy link
Member

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
Copy link

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
Copy link
Member

HebaruSan commented Feb 24, 2018

@Whovian41110
Copy link
Author

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

@Whovian41110
Copy link
Author

Whovian41110 commented Feb 24, 2018

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<T_REF> () [0x00015] in :0
at CKAN.ControlFactory.CreateControl<T_REF> () [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 Allow multiple distributions per file? #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 Allow multiple distributions per file? #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 CKAN file naming conventions #3: tid = 0x9878b7, 0x00007fff6d4e67fe libsystem_kernel.dylibsemaphore_wait_trap + 10, name = 'Finalizer' thread #4: tid = 0x9878d0, 0x00007fff6d4f0562 libsystem_kernel.dylib__workq_kernreturn + 10
    thread NUnit testing #5: tid = 0x9878d1, 0x00007fff6d4f0562 libsystem_kernel.dylib__workq_kernreturn + 10 thread #6: tid = 0x9878d4, 0x00007fff6d4f0562 libsystem_kernel.dylib__workq_kernreturn + 10
    thread Allow other licenses #7: tid = 0x9878de, 0x00007fff6d4f0ec2 libsystem_kernel.dylibkevent + 10, name = 'tid_5603' thread #8: tid = 0x9878df, 0x00007fff6d4f0ec2 libsystem_kernel.dylibkevent + 10, name = 'tid_a603'
    thread Signal when only *part* of a mod has been bundled. #9: tid = 0x9878e0, 0x00007fff6d4efcee libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'Timer-Scheduler'
    (lldb) thread backtrace all
  • thread Allow multiple distributions per file? #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    • frame #0: 0x00007fff6d4f0502 libsystem_kernel.dylib__wait4 + 10 frame #1: 0x0000000107f6dc8e monomono_handle_native_crash(signal=, ctx=, info=) at mini-exceptions.c:2731 [opt]
      frame Allow CKAN files to be generated from github releases #2: 0x0000000107fd8236 monoaltstack_handle_and_restore(ctx=0x00007ffee7d4cb40, obj=0x0000000000000000, stack_ovf=0) at exceptions-amd64.c:856 [opt] frame #3: 0x00007fff6754ffa8 SkyLightSLDisplayBounds + 83
      frame Shortname needs a better name #4: 0x000000011643a2ee
      frame NUnit testing #5: 0x00000001087473c6
      frame Try to define an ordering for versions #6: 0x0000000107ec44c7 monomono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=0x0000000000000000, exc=0x0000000116439c70, error=<unavailable>) at mini-runtime.c:2800 [opt] frame #7: 0x0000000108084ed4 monodo_runtime_invoke(method=0x00007fa1b4a4ebc0, obj=0x0000000000000000, params=0x0000000000000000, exc=0x00007ffee7d4d238, error=0x00007ffee7d4d410) at object.c:2849 [opt]
      frame Add the version of the spec to .ckan documents #8: 0x0000000108081024 monomono_runtime_class_init_full [inlined] mono_runtime_try_invoke(method=<unavailable>, obj=<unavailable>, params=<unavailable>, error=0x00007ffee7d4d410) at object.c:2956 [opt] frame #9: 0x0000000108080fdf monomono_runtime_class_init_full(vtable=0x00007fa1b4e93d08, error=0x00007ffee7d4d410) at object.c:473 [opt]
      frame Allow installation from already downloaded zip files #10: 0x0000000107ebd7ce monomono_jit_compile_method_inner(method=0x00007fa1b4a4ea48, target_domain=<unavailable>, opt=<unavailable>, error=0x00007ffee7d4d410) at mini.c:4343 [opt] frame #11: 0x0000000107ec0683 monomono_jit_compile_method_with_opt(method=0x00007fa1b4a4ea48, opt=, jit_only=0, error=) at mini-runtime.c:2129 [opt]
      frame Release Roadmap #12: 0x0000000107f700c1 monocommon_call_trampoline(regs=0x00007ffee7d4d4d8, code="H\x8b?H??\xa8H\x8b??8, m=0x00007fa1b4a4ea48, vt=<unavailable>, vtable_slot=<unavailable>, error=<unavailable>) at mini-trampolines.c:715 [opt] frame #13: 0x0000000107f6fbbc monomono_magic_trampoline(regs=0x00007ffee7d4d4d8, code="H\x8b?H??\xa8H\x8b??8, arg=0x00007fa1b4a4ea48, tramp=) at mini-trampolines.c:846 [opt]
      frame To store CKAN files in GameData or not? #14: 0x000000010838739e
      frame Preserved files #15: 0x000000010f93473b
      frame Allow upgrades #16: 0x00000001127efe4b
      frame Add a simple module registry #17: 0x00000001127ec06b
      frame Registry dicts #18: 0x0000000107ec44c7 monomono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=0x0000000000000000, exc=0x0000000108910bf8, error=<unavailable>) at mini-runtime.c:2800 [opt] frame #19: 0x0000000108084ed4 monodo_runtime_invoke(method=0x00007fa1b4df40b8, obj=0x00000001088c3a80, params=0x0000000000000000, exc=0x0000000000000000, error=0x00007ffee7d4e010) at object.c:2849 [opt]
      frame Coding Standards #20: 0x0000000108088d1b monomono_runtime_try_invoke_array [inlined] mono_runtime_invoke_checked(error=<unavailable>) at object.c:3002 [opt] frame #21: 0x0000000108088ce2 monomono_runtime_try_invoke_array(method=, obj=, params=0x0000000000000000, exc=0x0000000000000000, error=0x00007ffee7d4e010) at object.c:5145 [opt]
      frame Provide a way to specify licenses for each contained file. #22: 0x000000010802bb87 monoves_icall_InternalInvoke(method=<unavailable>, this_arg=<unavailable>, params=0x0000000000000000, exc=0x00007ffee7d4e170) at icall.c:3367 [opt] frame #23: 0x00000001084a1901 frame #24: 0x000000010a6ebdc3 mscorlib.dll.dylibSystem_RuntimeType_CreateInstanceMono_bool + 275
      frame Cached Download Fails #25: 0x000000010a6ebc9c mscorlib.dll.dylibSystem_RuntimeType_CreateInstanceSlow_bool_bool_bool_System_Threading_StackCrawlMark_ + 60 frame #26: 0x000000010a6eb77d mscorlib.dll.dylibSystem_RuntimeType_CreateInstanceDefaultCtor_bool_bool_bool_System_Threading_StackCrawlMark_ + 93
      frame Don't require verb to be first entry on command line #27: 0x000000010a69ac3f mscorlib.dll.dylibSystem_Activator_CreateInstance_T_REF + 143 frame #28: 0x000000010fdce31b frame #29: 0x000000010874fe03 frame #30: 0x000000010872b96d frame #31: 0x0000000107ec44c7 monomono_jit_runtime_invoke(method=, obj=, params=0x00007ffee7d4e738, exc=0x00007ffee7d4e170, error=) at mini-runtime.c:2800 [opt]
      frame Dependency processing #32: 0x0000000108084ed4 monodo_runtime_invoke(method=0x00007fa1b34025c8, obj=0x0000000000000000, params=0x00007ffee7d4e738, exc=0x0000000000000000, error=0x00007ffee7d4e778) at object.c:2849 [opt] frame #33: 0x00000001080884f9 monodo_exec_main_checked [inlined] mono_runtime_invoke_checked(method=, obj=, error=) at object.c:3002 [opt]
      frame Implement ckan update #34: 0x00000001080884b8 monodo_exec_main_checked(method=0x00007fa1b34025c8, args=<unavailable>, error=0x00007ffee7d4e778) at object.c:4726 [opt] frame #35: 0x0000000107f314bf monomono_jit_exec(domain=, assembly=, argc=1, argv=0x00007ffee7d4ea98) at driver.g.c:1040 [opt]
      frame Conflicts processing #36: 0x0000000107f33cb4 monomono_main [inlined] main_thread_handler at driver.g.c:1109 [opt] frame #37: 0x0000000107f33c81 monomono_main(argc=2, argv=) at driver.g.c:2222 [opt]
      frame Where do we store the CKAN repo? #38: 0x0000000107eb3e8d monomain [inlined] mono_main_with_options(argc=<unavailable>, argv=<unavailable>) at main.c:46 [opt] frame #39: 0x0000000107eb3e79 monomain(argc=2, argv=) at main.c:339 [opt]
      frame Update to allow a multi-level CKAN structure. #40: 0x0000000107eb3d84 monostart + 52 thread #2, name = 'SGen worker' frame #0: 0x00007fff6d4efcee libsystem_kernel.dylib__psynch_cvwait + 10
      frame Allow multiple distributions per file? #1: 0x00007fff6d62c662 libsystem_pthread.dylib_pthread_cond_wait + 732 frame #2: 0x000000010813dc9e monothread_func [inlined] mono_os_cond_wait(mutex=) at mono-os-mutex.h:173 [opt]
      frame CKAN file naming conventions #3: 0x000000010813dc8b monothread_func at sgen-thread-pool.c:165 [opt] frame #4: 0x000000010813dc7d monothread_func(data=0x0000000000000000) at sgen-thread-pool.c:196 [opt]
      frame NUnit testing #5: 0x00007fff6d62b6c1 libsystem_pthread.dylib_pthread_body + 340 frame #6: 0x00007fff6d62b56d libsystem_pthread.dylib_pthread_start + 377
      frame Allow other licenses #7: 0x00007fff6d62ac5d libsystem_pthread.dylibthread_start + 13 thread #3, name = 'Finalizer' frame #0: 0x00007fff6d4e67fe libsystem_kernel.dylibsemaphore_wait_trap + 10
      frame Allow multiple distributions per file? #1: 0x00000001080ea41c monofinalizer_thread [inlined] mono_os_sem_wait(flags=MONO_SEM_FLAGS_ALERTABLE) at mono-os-semaphore.h:90 [opt] frame #2: 0x00000001080ea411 monofinalizer_thread at mono-coop-semaphore.h:43 [opt]
      frame CKAN file naming conventions #3: 0x00000001080ea405 monofinalizer_thread(unused=<unavailable>) at gc.c:866 [opt] frame #4: 0x00000001080a66d0 monostart_wrapper [inlined] start_wrapper_internal at threads.c:1003 [opt]
      frame NUnit testing #5: 0x00000001080a6633 monostart_wrapper(data=<unavailable>) at threads.c:1063 [opt] frame #6: 0x00007fff6d62b6c1 libsystem_pthread.dylib_pthread_body + 340
      frame Allow other licenses #7: 0x00007fff6d62b56d libsystem_pthread.dylib_pthread_start + 377 frame #8: 0x00007fff6d62ac5d libsystem_pthread.dylibthread_start + 13
      thread Shortname needs a better name #4
      frame #0: 0x00007fff6d62ac40 libsystem_pthread.dylibstart_wqthread thread #5 frame #0: 0x00007fff6d4f0562 libsystem_kernel.dylib__workq_kernreturn + 10
      frame Allow multiple distributions per file? #1: 0x00007fff6d62b26f libsystem_pthread.dylib_pthread_wqthread + 1552 frame #2: 0x00007fff6d62ac4d libsystem_pthread.dylibstart_wqthread + 13
      thread Try to define an ordering for versions #6
      frame #0: 0x00007fff6d4f0562 libsystem_kernel.dylib__workq_kernreturn + 10 frame #1: 0x00007fff6d62b06a libsystem_pthread.dylib_pthread_wqthread + 1035
      frame Allow CKAN files to be generated from github releases #2: 0x00007fff6d62ac4d libsystem_pthread.dylibstart_wqthread + 13 thread #7, name = 'tid_5603' frame #0: 0x00007fff6d4f0ec2 libsystem_kernel.dylibkevent + 10
      frame Allow multiple distributions per file? #1: 0x0000000108024220 monoves_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.dylibkevent + 10
      frame Allow multiple distributions per file? #1: 0x0000000108024220 monoves_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 Allow multiple distributions per file? #1: 0x00007fff6d62c69b libsystem_pthread.dylib_pthread_cond_wait + 789 frame #2: 0x00000001081495d4 monomono_os_cond_timedwait(cond=0x00007fa1b3805890, mutex=0x00007fa1b3805850, timeout_ms=2999) at mono-os-mutex.c:44 [opt]
      frame CKAN file naming conventions #3: 0x00000001080c7884 monomono_w32handle_timedwait_signal_handle [inlined] mono_w32handle_timedwait_signal_naked(cond=<unavailable>, mutex=<unavailable>, timeout=2999, poll=0, alerted=<unavailable>) at w32handle.c:871 [opt] frame #4: 0x00000001080c787c monomono_w32handle_timedwait_signal_handle(handle=, timeout=, poll=0, alerted=) at w32handle.c:988 [opt]
      frame NUnit testing #5: 0x00000001080c76a0 monomono_w32handle_wait_one(handle=0x0000000000000008, timeout=2999, alertable=<unavailable>) at w32handle.c:1109 [opt] frame #6: 0x00000001080c79b6 monomono_w32handle_wait_multiple(handles=, nhandles=, waitall=, timeout=, alertable=) at w32handle.c:1145 [opt]
      frame Allow other licenses #7: 0x00000001080a1c64 monoves_icall_System_Threading_WaitHandle_Wait_internal(handles=<unavailable>, numhandles=<unavailable>, waitall=<unavailable>, timeout=-1, error=0x000070000353b7a8) at threads.c:1930 [opt] frame #8: 0x000000010fdfebfd frame #9: 0x000000010a83bdd0 mscorlib.dll.dylibSystem_Threading_WaitHandle_InternalWaitOne_System_Runtime_InteropServices_SafeHandle_long_bool_bool + 64
      frame Allow installation from already downloaded zip files #10: 0x000000010a83bd7c mscorlib.dll.dylibSystem_Threading_WaitHandle_WaitOne_long_bool + 44 frame #11: 0x000000010a83bbe3 mscorlib.dll.dylibSystem_Threading_WaitHandle_WaitOne_int_bool + 51
      frame Release Roadmap #12: 0x000000010a83bd0c mscorlib.dll.dylibSystem_Threading_WaitHandle_WaitOne_int + 28 frame #13: 0x000000010a842cef mscorlib.dll.dylibSystem_Threading_Timer_Scheduler_SchedulerThread + 2495
      frame To store CKAN files in GameData or not? #14: 0x000000010a834b77 mscorlib.dll.dylibSystem_Threading_ThreadHelper_ThreadStart_Context_object + 151 frame #15: 0x000000010a8327b1 mscorlib.dll.dylibSystem_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool + 33
      frame Allow upgrades #16: 0x000000010a832740 mscorlib.dll.dylibSystem_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object + 80 frame #17: 0x000000010a834cbf mscorlib.dll.dylibSystem_Threading_ThreadHelper_ThreadStart + 47
      frame Registry dicts #18: 0x00000001086caae9
      frame Add support for installing to Ships #19: 0x0000000107ec44c7 monomono_jit_runtime_invoke(method=<unavailable>, obj=<unavailable>, params=0x000070000353bea8, exc=0x0000000108a3dc90, error=<unavailable>) at mini-runtime.c:2800 [opt] frame #20: 0x0000000108084ed4 monodo_runtime_invoke(method=0x00007fa1b5a54350, obj=0x0000000108a3dd78, params=0x000070000353bea8, exc=0x0000000000000000, error=0x000070000353be40) at object.c:2849 [opt]
      frame Flip licenses in spec to Debian spec #21: 0x00000001080a66fb monostart_wrapper at threads.c:1011 [opt] frame #22: 0x00000001080a6633 monostart_wrapper(data=) at threads.c:1063 [opt]
      frame Allow for Non Default/Unusual KSP Install Location #23: 0x00007fff6d62b6c1 libsystem_pthread.dylib_pthread_body + 340 frame #24: 0x00007fff6d62b56d libsystem_pthread.dylib_pthread_start + 377
      frame Cached Download Fails #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
Copy link
Member

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
Copy link
Author

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

@HebaruSan
Copy link
Member

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

@Whovian41110
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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

@HebaruSan
Copy link
Member

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
Copy link
Author

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

@HebaruSan
Copy link
Member

HebaruSan commented Feb 25, 2018

Thank you! Can you please try this test version?

  • (download removed)

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

@Whovian41110
Copy link
Author

that strait up does nothing

@HebaruSan
Copy link
Member

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
Copy link

cherrydev commented Feb 25, 2018

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
Copy link

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
Copy link
Member

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

The current script is here:

CKAN/macosx/CKAN

Lines 1 to 23 in 86bf144

#!/bin/sh
# Check El Capitan's mono install location
PATH="$PATH":/usr/local/bin
export PATH
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.
# Fetch the path relative to the launch point where this shell script exists. (taken from Tasque & macpack)
APP_PATH=$(echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }')
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/Contents/MacOS"
exec -a "CKAN" "$MONO" --arch=32 $ASSEMBLY $@
fi

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
Copy link
Author

Yeah that new version doesn't work with me

@Whovian41110
Copy link
Author

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

@cherrydev
Copy link

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
Copy link
Author

so how do I edit the app to add this?

@cherrydev
Copy link

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
Copy link
Author

And this is a replacement for the whole executable?

@HebaruSan
Copy link
Member

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
Copy link

cherrydev commented Feb 25, 2018

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
Copy link
Author

So ill just wait then

@cherrydev
Copy link

cherrydev commented Feb 25, 2018

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
Copy link
Member

HebaruSan commented Feb 25, 2018

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
Copy link

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

@HebaruSan
Copy link
Member

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
Copy link
Member

HebaruSan commented Feb 25, 2018

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
Copy link

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
Copy link
Author

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

@HebaruSan
Copy link
Member

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

@HebaruSan HebaruSan self-assigned this Feb 27, 2018
@politas politas removed Network Issues affecting internet connections of CKAN Support Issues that are support requests labels Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Issues specific for macOS Mono Issues specific for Mono
Projects
None yet
Development

No branches or pull requests

4 participants