wrong number of arguments (given 0, expected 1) after deployment JROR - ruby-on-rails

Ror Experts,
I am having some kind of routing issue (I think so..). The Ahoy tracks visits and events in the development environment - running under webbrick server. When the application is deployed using warbler and published to apache tomcat server, it throws 500 error, Wrong number of Arguments (given 0, expected 1) while trying to log events. Tracking visits works as expected.
I have already tried suggestions mentioned in ahoy github account (https://github.com/ankane/ahoy/issues/356) without success.
I tried to debug if the data from react code is sending data as expected. It is indeed sending the data. I tried to post the data using postman directly to the controller using the same load to both development and deployed environment. It works on development but not on deployed.
I also tried to check error logs on the server. There is no information except 500 error.
Can someone help me out...
PS:
Prod server: Apache Tomcat
Environment: Jruby on rails
Front End: React

Found a solution. Fixed using gem as integral part of application instead of gem...... Still doesn't know what caused the issue. My gut feeling is some kind of routing issue with jruby and bundler warbler.

Related

Deploying to was with Docker, using Nginx, Browser --> Not found, the requested resource was not found on this server

I am new to this and I am following this tutorial https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/#static-files . It is teaching me how to Dockerize my Django app.
I have just tried to use Nginx. My containers are up. However,when I try to view my app on safari. It tells me that the requested resource was not found on this server. I think it has something to do with my ports. I am not sure. This is my code below. Thank you for any help you can give.
Check your DEBUG status, sometimes if DEBUG=0 in your enviroments variables testing show that error. Thats because Django cant load the welcome page for example in production.

Upgrading from jruby-9.0.5.0 hangs tomcat

I am trying to upgrade jruby. Went to a latest version 9.1.12.0, didn't work. Tried one version up (9.1.0.0) and same issue
The issue is it takes a very long time to boot on tomcat. Once tomcat starts the application it becomes unresponsive. Browser hangs forever and then eventually times out. Tomcat log shows that the request came, was served reply and closed (everything normal). No errors show up in tomcat log.
Tomcat is sitting behind apache, connected though AJP. I tried switching to http(s) and neither worked. Going directly to tomcat yields the same results.
I worked on solving this issue for quite some time. Not sure why it hangs and doens't throw any errors. Tried changing configurations on rails/tomcat/apache and could not find why it doens't work.
Any help tracking down this issue would be greatly appreciated
Current stack:
Rails 4.1..15
Jruby 9.0.5.0
Tomcat 6
Java 1.7.0_131
Apache 2.4.7
sounds like an enthropy depletion might be going on,
export JRUBY_OPTS=-J-Djava.security.egd=file:/dev/./urandom
or in your case :
export CATALINA_OPTS=-Djava.security.egd=file:/dev/./urandom
explanation is this' questions answer: After Upgrade To JRuby 9.1.9.0, Rails CookieStore Very Slow When Handling Encrypted Cookies
... the next jruby-openssl release should hopefully handle this better

Forbidden 403 for parse-server on version 2.2.24 and above

I want to update my server with the latest version of parse server, but I am running into the issue where are all the calls send back a 403 Forbidden.
The exact same calls work on 2.2.23 and below but not on 2.2.24 and above. I am using parse for an iOS app, where I am using SDK 1.14.
Notes on the setup:
added VERBOSE environment variable, logs correctly on 2.2.23 but nothing on 2.2.24
running the server in localhost with node v6.9.1 installed.
pointing to a DB in mLab with mongod version: 3.0.12.
using express "~4.14.x"
Reviewed issues:
https://github.com/ParsePlatform/parse-server/issues/508 Where the
user was able to fix it by starting from scratch with
parse-server-example. I have tested this, using my ParseServer
instantiation and copying over the cloud code, I am having the same
issue.
https://github.com/ParsePlatform/parse-server/issues/1017 Was about
passing the X-Parse-Application-Id, which I am doing since it is
working for 2.2.23 but not for 2.2.24 and higher
Has anybody experienced something similar? Any hint on what I could try?
Thanks!

How to debug ElasticBeanstalk error "X% of the requests are failing with HTTP 5xx"

My problem is similar to AWS: None of the Instances are sending data but has a slightly different error message.
I have a Rails application running on ElasticBeanstalk, and it appears to be running correctly. Periodically, Enhanced Health Monitoring sends me error messages such as:
Environment health has transitioned from Ok to Degraded. 20.0 % of the
requests are failing with HTTP 5xx.
where the percentage varies up to 100%. Even though I've made no changes, a minute later I get a followup message telling me that everything is back to normal:
Environment health has transitioned from Degraded to Ok.
I've downloaded the full logs from ElasticBeanstalk but I don't know exactly where to look (there are around 20 different log files in various directories).
I'm currently using the free AWS tier with the smallest instances of database, server, etc. Could this be the cause? Which of the log files should I be looking in, and what should I be looking for?
I run rails apps on Elastic Beanstalk and have found it helpful to think about Beanstalk as a computer (in this case an Amazon EC2 instance) running your rails app and a web server (either Passenger or Puma). When you get a 500 error, it could be because your rails app didn't properly deploy–in which case Passenger or Puma will return an error—or your app is deployed properly but encountered an error just like it might on your local machine.
In either case, to diagnose an error, download the full logs from your AWS console (open the correct app environment and then choose Logs > Request Logs > Full logs > Download). Deployment errors are harder to diagnose, but I recommend starting by looking in var-XX/logs/log/eb-activity.log. I suspect your error is coming from your rails app itself, in which case I recommend looking in var-XX/app/support/logs/passenger.log and production.log. To find a 500 error, search for "500 Internal" and then treat the error like you would any other rails error.
You can go to the EC2 instance and run the application just like you would run on your local machine and see the logs.
You can ssh into your EC2 instance using the command eb ssh and go to /opt/python/ directory (It will be different for Ruby or other programming languages).
/opt/python/run is the directory where you will find the version of your application which is run from the EC2 instance. Look for the directory venv and app inside run directory.
Note: The above folder structure is for Python but a similar folder structure post deployment can be found for any other programming language. Just look for the standard directory structure for the deployment environment for your programming language.
For Python:
/opt/python: Root of where you application will end up.
/opt/python/current/app: The current application that is hosted in the environment.
/opt/python/on-deck/app: The app is initially put in on-deck and then, after all the deployment is complete, it will be moved to current. If you are getting failures in your container_commands, check out out the on-deck folder and not the current folder.
/opt/python/current/env: All the env variables that eb will set up for you. If you are trying to reproduce an error, you may first need to source /opt/python/current/env to get things set up as they would be when eb deploy is running.
/opt/python/run/venv: The virtual env used by your application; you will also need to run source /opt/python/run/venv/bin/activate if you are trying to reproduce an error.
I know it is a little late but I wanted to comment the trick I use to find the error, I use to connect via ssh and then, once in the app I try to enter "rails console" It uses to fail, but it shows normally the error you´re making. This little trick saved my life several times. Hope it helps!

Rails Dev Server not visible on network

Trying to do something very basic and test my Rails app on my phone.
Starting the server with:
rails s
But when accessing mymachinename.local:3000, Mobile Safari says that the server stopped responding after about 30 seconds.
I do this all the time on other machines, but I have no idea what could be causing it here. Any suggestions?
I've had a similar issue before trying to access the server from a virtual machine, I had to use the following format for the rails server command:
rails s -b your.dev.ip.address
Whoops. Firewall. Don't know why I even had it turned on.

Resources