Giter Site home page Giter Site logo

"Google::Cloud::Vision.image_annotator" crashes Puma app server in Rails controller, but same code runs fine as a standalone ruby script about google-cloud-ruby HOT 2 OPEN

sampenguin avatar sampenguin commented on July 26, 2024
"Google::Cloud::Vision.image_annotator" crashes Puma app server in Rails controller, but same code runs fine as a standalone ruby script

from google-cloud-ruby.

Comments (2)

dazuma avatar dazuma commented on July 26, 2024

A few clarifying questions:

  1. By "crash" do you mean some kind of operating system process crash, like a segmentation fault or something? (Sorry, I'm unfamiliar with what those look like in Windows.)
  2. Is the difference between the succeeding standalone script and the crashing Rails app only the fact that Rails is running in the latter? i.e. are you running on the same Windows workstation in both cases? How are you launching Rails? Do you have some kind of Windows-based Rails launcher, or are you starting it with rails server? Do you have any fancy auto-reloading or process caching system like bootsnap running in your Rails setup, and if so can you try turning those off?
  3. I assume you have googleauth 1.11.0 in your bundle. As an experiment, can you try downgrading the googleauth gem to version 1.8.1 and retry?

from google-cloud-ruby.

sampenguin avatar sampenguin commented on July 26, 2024
  1. Sorry I could have been clearer. The Puma server shuts down immediately, without warning or logging anything. So just the app server that is responsible for executing the rails controller code halts, there is not an OS crash. The web server and other processes do not go down with it.
  2. Yes both running on the same Windows workstation. My development setup uses PowerShell 7.4.2, so I'll have usually a handful of PowerShell windows open, running processes. The core stack is nginx as https, Puma 6.4.2 (ruby 3.3.3-p89) as the Rails 7.1.3 server, and Sidekiq 7.2.2 that runs a few worker tasks on startup or for mail processing (none of which are proc'ing when I do these tests). All of the processes are started manually via various bat scripts, but ultimately they boil down to the simple commands of rails server, bundle exec sidekiq etc. so there is nothing fancy or automated in my development environment.
    When I execute the successful standalone script, it's also done through a PowerShell window
  3. There are two Google gems installed from my Gemfile currently: gem 'googleauth', '~> 1.11' and gem 'google-cloud-vision' (and of course all their dependencies). I will try the downgrade at next opportunity and report back!

As a bit of further info re: all other pieces of the auth chain working, I have been working around this by not using the gem features and instead doing direct https calls to the Google Cloud Vision API successfully and seeing it tracked on Cloud Console. So all the auth info seems to be correct, fwiw.

from google-cloud-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.