React error: request failed with status code 400 - reactjs

I am following Bezkoder tutorial in the link to create a simple CRUD database using React, NodeJS, Express and MySQL: [https://www.bezkoder.com/react-node-express-mysql/#React_Nodejs_Express_MySQL_Architecture
I've successfully created the backend and tested read, write and delete of records using POSTMAN. I've then created the React frontend, which uses Axios - it compiles OK, and displays a web page in my browser. This page will read records from the database OK, but when I try to add new or amend existing records, it doesn't work, and in console it displays "Request Failed with status code 400" error. The full error message in console is as follows:
Console error
I'm not sure what the error means or how I might go about troubleshooting further. Could anyone point out to me how I can troubleshoot this further or what other info you'd need to help me?
I was expecting the React frontend to be able to add new records and amend existing records.

Related

axios stop posting the request in react js

I want to make a website that interact with mysql server. Here is my server code
1
Here is my client code
2
and my problem is that after I have some error about mysql query like I insert a duplicate entry, I change the data of the form and submit again, the website remain no response. Can anyone have the same question and know what is the problem in my code.
I check the status of the network and i find that i cannot update the list after the insert is pending. How can I deal with the problem. Should i cancel the request?3

delete_model() error when cleaning up AWS sagemaker

I followed the tutorial on https://aws.amazon.com/getting-started/hands-on/build-train-deploy-machine-learning-model-sagemaker/
I got an error when trying to clean up with the following code.
xgb_predictor.delete_endpoint()
xgb_predictor.delete_model()
ClientError: An error occurred (ValidationException) when calling the DescribeEndpointConfig operation: Could not find the endpoint configuration.
Does it mean I need to delete the model first instead?
I checked on the console and deleted the model manually.
No, you don't need to delete the model prior to deleting the endpoint. From the error logs looks like its not able to find the endpoint configuration. Can you verify if you are setting delete_endpoint_config to True
xgb_predictor.delete_endpoint(delete_endpoint_config=True)
Additionally, you can verify if the endpoint_config is still avaiable on the AWS console.

React fetching timeout

I have a react app with express backend. When I make a post request from react, I can see the query being run in the database. however, when the query takes more than 2 minutes to run, React fetch process would stop, although the query would still keep running in the database and would return the result to express (I know it returned data to express because I had a console.log in the express code to show data length which did show up in the console after the query stopped running).
In the front end, it would show the following error. Anybody has any suggestions on how can run large query from React and get the data back without timeout? I have tried all the timeout settings, etc. thank you
POST http://localhost:4000/results net::ERR_EMPTY_RESPONSE
(anonymous) # C:\Users...
1 Uncaught (in promise) TypeError: Failed to fetch

Akeneo import returning 500 on upload

When creating a import-profile in Akeneo i.e. XLSX, and then trying to upload and import a file Akeneo shows the spinner for infinite time. When I use the inspector window i see that the POST request to /launch that is apparently part of the rest API ( baseURL /job-instance/rest/import/product_variant_import/launch ) is returning this 500 error preventing Akeneo from proceeding.
First i thought it might had something to do with upload permissions but uploading media works fine. Unfortunately because of the 500 error there is nothing in the apache logs.
I'm using the basic apache configuration that is suggested in the set-up guide ( https://docs.akeneo.com/3.1/install_pim/manual/system_requirements/manual_system_installation_debian9.html ) under Apache.
I can't find anything on this subject online (Akeneo import + 500 error), so hopefully any of you have suggestions on what might cause this.
Best,
Seb
You should check the log and to have more information. And know what is happening exactly. If you can't check it, try to use xdebug to debug akeneo and stop it here:
/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php
Line 225:
private function handleException(\Exception $e, $request, $type)
And you will know what error you have.
EDIT:
We were talking via slack, and he sent me the error. He had problems due permissions
The error that he sent me:
“Impossible to create the root directory “/tmp/pim/file_storage/13_Product_variant_import_CSV”.

Form upload 404 error in Open Data Kit

I am working on a project and needed to collect data using open data kit. I have created a server using google app engine, but when uploading the form to the aggregate server, I get this error:
sample-Error: Not Found (404) at
http://odkproject- 207015.appspot.com/ODKAggregate/submission?deviceID=imei%3A864898033928120
404 is returned if the form you're submiting is does not exist on the server.
You have to delete all forms and load them back.
Hope it fixes your issue.

Resources