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

rails with spring gem and google/cloud/firestore thread fault #604

Open
davingee opened this issue Nov 9, 2019 · 10 comments
Open

rails with spring gem and google/cloud/firestore thread fault #604

davingee opened this issue Nov 9, 2019 · 10 comments

Comments

@davingee
Copy link

davingee commented Nov 9, 2019

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

  1. install rails (5.2.3)
  2. install spring (2.1.0)
  3. 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.
@pcriv
Copy link

pcriv commented Nov 25, 2019

@davingee I'm having a similar issue, what OS are you on?

@jpaas
Copy link

jpaas commented Nov 28, 2019

Same here. Catalina 10.15.1, Rails 6.0.1, ruby-2.6.5

@jpaas
Copy link

jpaas commented Nov 28, 2019

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.

@pcriv
Copy link

pcriv commented Nov 28, 2019

Did you see this issue?

@jpaas
Copy link

jpaas commented Nov 29, 2019

Yep watching that one too. My workaround atm is to uninstall spring from my rails project. 😢

@pcriv
Copy link

pcriv commented Dec 19, 2019

@jpaas my workaround so far it's running all commands with DISABLE_SPRING=1

@jpaas
Copy link

jpaas commented Dec 19, 2019

Ah that's handy. Thanks @pablocrivella !

@pcriv
Copy link

pcriv commented Jan 24, 2020

Re-installing PostgreSQL fixed the issue for me. Check ged/ruby-pg#311 (comment)

@jpaas
Copy link

jpaas commented Jan 24, 2020

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.

@gaga5lala
Copy link

gaga5lala commented Nov 22, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants