Project

General

Profile

Actions

Feature #2757

closed

Show errors logs in the production.log for the API

Added by Lukas Zapletal almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by Tomáš Strachota almost 11 years ago

  • 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?

Actions #2

Updated by Lukas Zapletal almost 11 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from Foreman API hides exceptions to Show errors logs in the production.log for the API
Actions #3

Updated by Marek Hulán almost 11 years ago

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.

Actions #4

Updated by Lukas Zapletal almost 11 years ago

  • 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.

Actions #5

Updated by Sam Kottler almost 11 years ago

  • Status changed from New to Assigned

Any update on this? Tomas, I'm happy to work on this if you're not already.

Actions #6

Updated by Tomáš Strachota almost 11 years ago

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.

Actions #7

Updated by Tomáš Strachota almost 11 years ago

  • Status changed from Assigned to Ready For Testing
Actions #8

Updated by Dominic Cleal over 10 years ago

  • Target version changed from 1.2.1 to 1.3.0
Actions #9

Updated by Anonymous over 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF