Mini_suffix and "unknown file type"

Okay. I give. I’ve spent the last six hours trying to nail this one down with no luck.

I took a week off and had a functioning development environment running beforehand. When I attempted to load my local Discourse instance this morning it failed with the following error:

Joes-MBP:discourse joebuhlig$ bundle exec rake db:migrate --trace
rake aborted!
LoadError: Could not open library '/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/vendor/libpsl.so': dlopen(/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/vendor/libpsl.so, 5): no suitable image found.  Did find:
	/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/vendor/libpsl.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
	/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/vendor/libpsl.so: stat() failed with errno=25
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/ffi-1.9.18/lib/ffi/library.rb:147:in `block in ffi_lib'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/ffi-1.9.18/lib/ffi/library.rb:100:in `map'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/ffi-1.9.18/lib/ffi/library.rb:100:in `ffi_lib'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/lib/mini_suffix.rb:7:in `<module:MiniSuffix>'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/mini_suffix-0.2.0/lib/mini_suffix.rb:4:in `<main>'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `require'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/bootsnap-1.0.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `require'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `block (2 levels) in require'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `each'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `block in require'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `each'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `require'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in `require'
/Users/joebuhlig/Codebase/discourse/config/application.rb:22:in `<top (required)>'
/Users/joebuhlig/Codebase/discourse/Rakefile:5:in `require'
/Users/joebuhlig/Codebase/discourse/Rakefile:5:in `<top (required)>'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/rake_module.rb:29:in `load'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:688:in `raw_load_rakefile'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:97:in `block in load_rakefile'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:96:in `load_rakefile'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:80:in `block in run'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:179:in `standard_exception_handling'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/lib/rake/application.rb:78:in `run'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/bin/rake:22:in `load'
/Users/joebuhlig/Codebase/discourse/vendor/bundle/bin/rake:22:in `<top (required)>'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli/exec.rb:75:in `load'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli/exec.rb:75:in `kernel_load'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli/exec.rb:28:in `run'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli.rb:424:in `exec'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli.rb:27:in `dispatch'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/cli.rb:18:in `start'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle:30:in `block in <top (required)>'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/site_ruby/2.4.0/bundler/friendly_errors.rb:122:in `with_friendly_errors'
/Users/joebuhlig/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>'
/Users/joebuhlig/.rbenv/versions/2.4.1/bin/bundle:23:in `load'
/Users/joebuhlig/.rbenv/versions/2.4.1/bin/bundle:23:in `<main>'

What I’ve tried:

  1. Switching from rvm to rbenv.
  2. Removing all gems on my machine and reinstalling multiple times on both rvm and rbenv.
  3. Completely removing the /discourse repository and cloning again.
  4. Uninstalling and reinstalling XCode and XCode CLT.
  5. Updating the OS to the latest (that was needed for other reasons as well but happened after the above).
  6. Multiple restarts.

None of this even changed the error message. It’s remained the same.

At the moment I’m looking at an attempt to do local Docker development just to get a different environment running.

Anyone have ideas? I’m hoping this is a case of “spent-too-long-looking-at-it-and-cant-see-the-obvious”.

4 Likes

I have the same issue; seems to impact all dev environments on OSX — @tgxworld made some changes in the past 24 hours that may have broken things?

I think specifically
https://github.com/discourse/mini_suffix/commit/129964864513eef36c675cdd709ffcd9075437be

OSX doesn’t like the .so filetype

Not sure if anyone else on the @team has any ideas, or if we’ll just wait for @tgxworld (it’s 4am in his time zone, so I assume he’s asleep)

12 Likes

Let me know if the following commits do not fix it. I hope no one is developing on windows :wink:

https://github.com/discourse/mini_suffix/commit/5dc77c137cacbdc6d53b71804c58eac558933c0c

https://github.com/discourse/discourse/commit/30534993759f39ae5b490fcc2d7f875c1590fc1d

4 Likes

Why is this creating so many platform specific problems for us?

I decided to package the shared libraries into the gem instead of having users install libpsl themselves which means having to compile it manually.

This topic was automatically closed after 3 days. New replies are no longer allowed.