CKAN Version:
1.25.4
Mono Version:
5.16.0.220
KSP Version:
1.6.0
Operating System:
OS X 10.13.6 (High聽Sierra)
Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
No, just ran 'brew upgrade,' as I planned to check for updated KSP add-ons for the 1.6 update.
What steps did you take in CKAN?
None, tried starting it from the command line via 'ckan consoleui'
What did you expect to happen?
The ckan console UI would start
What happened instead?
received an unhandled exception error
Screenshots:

CKAN error codes (if applicable):
Unhandled Exception:
System.InvalidOperationException: object_op ---> System.EntryPointNotFoundException: SystemNative_RealPath
at (wrapper managed-to-native) Interop+Sys.RealPath(string)
at System.IO.CoreFX.FileSystemWatcher+RunningInstance.Start () [0x00000]
(and so on)
What was updated by the "brew upgrade" command?
To clarify, on the Mac, ckan (and its dependency mono) is typically installed via brew (also known as Homebrew, a Mac package management system). The 'brew upgrade' command simultaneously updates the homebrew installation and any outdated packages.
Right. Can you report what changed when you ran that command this time? That appears to be key to the problem you're having.
It appears that the mono formula updated from 5.14.0.177 to 5.16.0.220. I'm trying to hack the formula locally to install the older version of mono to see if that fixes the problem.
Okay, I have a (temporary) fix. Warning: it's not pretty.
Please do not follow these instructions unless you understand what each one does or you're willing to deal with a broken CKAN/Mono/Homebrew install if something goes wrong.
ckan and mono from Homebrew.brew update.brew edit mono.url, sha256, and bottle lines to look like url "https://download.mono-project.com/sources/mono/mono-5.14.0.177.tar.bz2"
sha256 "d4f5fa2e8188d66fbc8054f4145711e45c1faa6d070e63600efab93d1d189498"
bottle do
sha256 "f31bcdbf40da4f3160c6257e62532e82fda34f00e8170424d85b3737cc166c74" => :mojave
sha256 "32a208795022a8aa55c86c4f77aca63725d9fe957998c160e43b9048898ce2fa" => :high_sierra
sha256 "5b881b5ed9b9fdcef2003dc6f525887f27df2278349644dc8ba446ea4a1b62e5" => :sierra
sha256 "22551363ddcd90271af6bac89055ea7bfdf0647455b9ea0be355649dfc6e6e9a" => :el_capitan
end
brew install mono. You should see Mono 5.14.0.177 being installed.brew install ckan. You should see CKAN 1.25.4 being installed.ckan consoleui. You should be golden.As far as I can tell, these changes to the mono formula will remain even after running brew update in the future, so you'll probably want to undo them at some point in the future. How one does that, I don't currently know.
Thanks, that's good to know. This error is saying that Mono can't find some code in the OS that it expects to be there, which isn't something CKAN could cause or fix. It's possible that brew messed up the packaging somehow, or it's possible there's a bug in Mono 5.16.
You might try installing Mono 5.16 without brew, but I know that might be inconvenient.
If that solves it, this should be reported to the Homebrew team.
Otherwise this should be reported to the Mono team.
This is the specific call in Mono that's failing, for future reference.
https://github.com/mono/mono/issues/8712
looks kinda related on a first glance, this was in the changelog of mono 5.16 and affects Mac.
Check out mono/mono#9576 though. Same exception and call stack.
They fixed it with xamarin/xamarin-macios#4447, "Include libmono-system-native on Xamarin.Mac", in July of this year.
@grahamj1978, does brew have a libmono-system-native package? Maybe they split that into a separate install in Mono 5.16.
The easiest and quickest way might be uninstall the brew one and install the one from the official homepage: https://www.mono-project.com/download/stable/
This worked for me.
I might just give the package install a try. Brew now has mono 5.18.0.225, but it doesn't seem to resolve the issue (same error).
@HebaruSan, I don't see a libmono package using the 'brew info' command, so I so assume not. The only 'mono' package it can fine in the mono install itself.
@grahamj1978 or @CraigCottingham or @gullevek , would one of you be willing to volunteer to please report this to Homebrew? I don't have a Mac and would not be able to answer clarifying questions or test their fixes.
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!
I was able to do a brew uninstall --ignore-dependencies mono and brew cask install mono-mdk and ckan is functional with ckan consoleui and other text-only commands.
If anyone does decide to take this to the Homebrew team, it looks like the cause may be that libmono-system-native is missing. A similar thing happened in #2664, and that's how Debian is planning to fix it.
Quoth the Homebrew folks:
Conclusion, Homebrew isn't a reliable way to install software. They don't investigate or fix problems; users are expected to do that for themselves.
I've hidden the Homebrew instructions on the CKAN wiki's OSX page, and any further CKAN issues mentioning Homebrew will be summarily closed.
Update, the Homebrew devs have closed the issue without fixing or even investigating it. They apparently do not care about problems in their distribution system that result in broken software for users. Frankly I'd see that as a reason to never use Homebrew for anything, not just CKAN.
In defense of the Homebrew maintainers, this wasn't an issue with Homebrew as much as it was with the Mono formula for Homebrew, and the maintainer(s) for that aren't necessarily the same as the Homebrew maintainers. Whether or not this issue was passed on to the Mono maintainers, I don't know. That might have been our (read "my") responsibility.
I don't want to get into a debate over the merits and demerits of Homebrew. If it works for you, great; if it doesn't, that's fine too. If the official position of CKAN is that Homebrew should not be used to install CKAN, I won't object.
I'm not sure CKAN can (or should) have an official position, but we ought to avoid steering users toward a solution that we know in advance won't work in our documentation, at least. And I thought they said that formulas don't have specific maintainers to whom such issues could be passed on. So if/when issues like this do arise, we're depending on Joe Random User to donate the hours and expertise to figure it out.
Agreed that folks should use what works for them and not what doesn't, but I wonder how many of the users who think that Homebrew works for them are aware that packages can break and stay broken with no process for getting a fix (or even continuing to track the fact that they are broken!).
I wonder what they'll do if another user reports this. Close it as a duplicate of a closed and unfixed issue?
@HebaruSan I've only just started with CKAN today (been away from KSP for a few years), but is there a reason using homebrew-cask wouldn't work for folks? I'm a big fan of cask for any macOS app I can use it for, and both ckan and mono-mdk (listed as a dependency in the ckan cask file) are part of hbc. I gave it (brew cask install ckan) a whirl today (on El Capitan, inre #1501) and see no issues yet. Shouldn't need to muck about with brew.
@Amorymeltzer, your timing is impeccable, @alebcay fixed the mono formula just days ago in Homebrew/homebrew-core#41728. So it works for now (probably).