Feature #2757
closed
Show errors logs in the production.log for the API
Added by Lukas Zapletal over 11 years ago.
Updated over 11 years ago.
Description
When I call any Foreman New API service and it fails during saving in ActiveRecord, only ActiveRecord::RecordNotSaved exception (message) is shown and the reason (errors array) is hidden.
We need to use either save! method when saving or handing the active record object into the base controller for checks.
- Assignee set to Tomáš Strachota
I haven't managed to reproduce it. Can you please provide more details? What api version and resource you tried it with? Did you use foreman-api library or was it via curl?
- Tracker changed from Bug to Feature
- Subject changed from Foreman API hides exceptions to Show errors logs in the production.log for the API
Not sure whether it helps, but anyway.. I encountered similar error because of validation errors on some associated object a month ago. Save returned false (which is usually not checked) and errors on main object was empty. Could this be the cause? Particular problem I described is already fixed btw.
- Target version changed from 1.3.0 to 1.2.1
Marek, this must be something else. In my case, I do see errors array but there is no way of digging in the problem.
Since users are reporting issues with this on the channel, I am setting target version to 1.2.1. Tomas can you please provide fix for 1.2 stable? Users are starting with the API and hitting errors, this could help them to track validation problems.
- Status changed from New to Assigned
Any update on this? Tomas, I'm happy to work on this if you're not already.
I wanted to start today but got stuck with other tasks. Feel free to take it if you want. Otherwise I'll do it tomorrow (Friday) morning.
- Status changed from Assigned to Ready For Testing
- Target version changed from 1.2.1 to 1.3.0
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF