spring
spring copied to clipboard
rails with spring gem and google/cloud/firestore thread fault
if i install google/cloud/firestore i get a threading fault.
Environment details
- OS: Mac OS Catalina 10.15
- Ruby version: ruby-2.4.5
- Gem name and version: google-cloud-firestore (1.1.0)
Steps to reproduce
- install rails (5.2.3)
- install spring (2.1.0)
- rails c
Code example
require "google/cloud/firestore"
firestore = Google::Cloud::Firestore.new(
project_id: 'project_id',
credentials: "/path.json"
)
city_ref = firestore.doc "cities/LA"
data = {
name: "Los Angeles",
state: "CA",
country: "USA"
}
city_ref.set data
Full backtrace
2.4.5 :019 > city_ref.set data
objc[17615]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[17615]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
@davingee I'm having a similar issue, what OS are you on?
Same here. Catalina 10.15.1, Rails 6.0.1, ruby-2.6.5
For me it only started in the past couple of days. We've been using spring 2.1.0 for a while now. The crash happens if I try using ActiveRecord in a rails console.
Did you see this issue?
Yep watching that one too. My workaround atm is to uninstall spring from my rails project. 😢
@jpaas my workaround so far it's running all commands with DISABLE_SPRING=1
Ah that's handy. Thanks @pablocrivella !
Re-installing PostgreSQL fixed the issue for me. Check https://github.com/ged/ruby-pg/issues/311#issuecomment-576837101
I just tried it but it didn't help.
In my setup I am running postgres in a Docker container. I use Homebrew to install postgresql just for the lib so that I can use rails in macland.
rails s running on Catalina works fine against my Docker postgres.
rails c running on Catalina always segfaults.
I had the same issue when using google-cloud-translate (3.2.2) in rails console While rails server works fine with both puma and passenger.
objc[60612]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[60612]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
- ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin20]
- Rails 6.0.4.1
- ruby Spring version 3.0.0
- MacOS 11.4 Big Sur
grpc (1.38.0)
google-protobuf (~> 3.15)
googleapis-common-protos-types (~> 1.0)