I have a rails app with one form. After saving that form all data will be send in an email id. Form is working great in development side. But after deploying the app it doesn't work. It's giving the following error in the browser.
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
In this application I have another contact us form. That form work fine after deployment in production side.
Related
I am using IPN to receive payment notifications in an MVC system I'm working on. After verifying certain bits and pieces, I proceed to update the database with the "subscription" and "payment details" for the particular user. I am using "notify_url" to redirect back to the system and initiate the PaymentNotification method. This was working correctly up until a few days ago, when it all of a sudden just stopped working. First I thought that the database was not being updated due to an issue within the method itself, but then I noticed that the PaymentNotification (IPN) method was not being hit at all.
Some notes:
A test from the paypal developer's page seemed to redirect correctly
into the IPN. Calling the link directly from the browser hits the method also, so it seems to be externally accessible.
I am using NGROK to make the localhost look like it's
running from a live domain. It does not work with either HTTP or
HTTPS. I am also testing on a hosted environment, with sandbox configuration, within an HTTP domain, and it is not working either.
I am debugging the hidden values in the validation form, right
before redirecting to Paypal and all the values, including:
notify_url are correctly populated. This was working but suddenly
stopped.
Some questions:
What could be the reason? Why would it work all throughout the development
stages but suddenly stop working? Of course, I can't afford to have
this stop working on the live environment!
Is this perhaps an issue
with the sandbox environment? Is IPN safe for Live systems? Can someone talk from experience?
Or
is there perhaps a better option I can look into?
I read this article, which
discusses verifying/activating the email address of the sandbox
account. Can anyone indicate what that might be? And whether the same
email addresses being used could have been working but suddenly
stopped? Do they need to be real emails? As the ones that I was using (and were also working) are not tied to real paypal accounts.
As suggested in the comment, even just for testing Paypal in Sandbox mode, since September 2016, TLS 1.2 is required for PayPal IPN processing. In my case, changing the Sandbox testing business and personal emails to real / valid emails, solved my issue with regards to testing locally using NGROK as a secure tunnel to Local host. More so, this should not be a problem when I actually use the HTTPS certificate.
My rails application sends emails through a gmail account using mailer. Till recently everything was working fine. But now sometimes I get the error as
"Net::OpenTimeout: execution expired"
This happens sometimes and sometimes it works. I want to know the reason for this behavior. Is it because of the gmail server having load balancing issues or is it because of some configuration issues in the rails app?
Everything works fine in a development/localhost environment.
When deploying to heroku, using sandbox/test credentials on a new app, and creating a new payment I am getting
A PayPal::SDK::Core::Exceptions::UnauthorizedAccess occurred in orders#create:
Failed. Response code = 401. Response message = Unauthorized.
Again, everything thing works in a development environment
Should I permit any specific domains (like in Facebook integration)?
If you are running a Rails application on a public server, there is quite a chance that the Rails environment is set to "production".
If you further use the config/initializers/paypal.rb and config/paypal.yml generated by the Paypal API SDK's standard generator, then:
the initializer loads configuration for the current Rails environment, which is "production"
and in the production configuration one important line presumes that you want to run on the live API
So most probably you are attempting to communicate with the live API without knowing it. Changing the line to mode: sandbox should make you happy.
I had this problem and I called Paypal. It was a config problem in my account.
To resolve I went to https://developer.paypal.com, logged in, Then clicked on Dashboard Then on my account (left) The Direct credit cards has a grey x next to it so you have to click the link next to it that reads Enable live credentials Once you do this you have to answer some verification questions then they approve your account then your live and the unauthorized error goes away.
I am using Devise and it sends out a confirmation email when a new user account is created. Since I am in development, in localhost, it doesn't really send out the email, so I just copy the confirmation link from the server info that appears on the console.
The thing is, as one particular page grew, the amount of information that the server processes after the email is sent became too large for the terminal, the backscroll ends before I reach the link. I checked /log/development.log but it logs other things. I studied the config and debug parts of the rails doc but I couldn't find anything about server logging.
So now I have no way of copying the confirmation link from the console, and no way of confirming new accounts, which I still need to do since it is part of the proposed flow.
How can I get the server logs?
After restarting a Rails app in production environment and submitting a login form for the first time the application throws an "ActionController::InvalidAuthenticityToken" error.
After the first form submit everything works fine.
The application only logs the action and controller parameters for the first request: {"action"=>"create", "controller"=>"user_sessions"}. All the form parameters, including the authenticity token don't show up, which would explain the error message. Looking at that first form submit post request on the client side I confirmed that the form is submitted correctly (all the parameters are posted correctly)
Production setup gist: Rails 2.3.3, Apache2, Mongrel Cluster, default cookie session store
Local development environment does not have the same issue.