Report this

What is the reason for this report?

Node.JS Issues writing to Google Cloud SQL but can read just fine

Posted on September 18, 2020

I have a Node API on a Droplet with a React Front End. When I spin up the environments locally the API read/writes just fine but when I deploy them on their respective Droplets, I can read data from the Node API but I can not write data.

The react Droplet can read and display the data from the API droplet but when it writes, the API sends a 200 response but no data is actually written.

When I investigate on the API Droplet server, I don’t notice anything in the error logs (Nginx) but apparently I am missing something.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

Consider following scenario, please. Your API has got a bug, supposedly. You get an OK status (200) because data was successfully transferred from front-end app to back-end, without checking if it was actually written. So, I would start troubleshooting your issue on Google Cloud SQL side. I would check permissions for accessing SQL database.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.