Bug #4761

MAD logging does not work

Added by EOLE Team almost 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:09/02/2016
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

0%

Category:Drivers - VM
Target version:Release 5.2
Resolution:fixed Pull request:
Affected Versions:OpenNebula 5.0

Description

Hello,

Looking at logs for #4298, I finally found that the mad script logging is not working even with ONE_MAD_DEBUG=1.

I found some use of 2>&1 1>/dev/null which redirect stderr to stdout and then stdout to /dev/null.

But this is not enough.

Associated revisions

Revision b5dec052
Added by Jaime Melis almost 5 years ago

Bug #4761: MAD logging does not work

Revision 81c6f204
Added by Jaime Melis almost 5 years ago

Bug #4761: Log only formatted messages when successful, everything
otherwise

Revision 0c3b229a
Added by Jaime Melis almost 5 years ago

Bug #4761: Fix serverardmin login (one_auth_mad)

History

#2 Updated by Ruben S. Montero almost 5 years ago

  • Assignee set to Jaime Melis
  • Target version set to Release 5.2

We'd look into it. THANSK!!!

#3 Updated by Jaime Melis almost 5 years ago

We believe that the current code is OK. As far as we can tell: 2>&1 1>/dev/null means: 1) send stdout to devnull 2) send stderr to the old stdout. In other words, it should discard stdout and put stderr in stdout.

Example:

$ ls / /asfa 2>&1 1>/dev/null
ls: cannot access '/asfa': No such file or directory

$ ls / /asfa 2>&1 1>/dev/null | grep -o ls
ls

Can you let us know an example where the MAD is not logging properly? I agree there is a problem somewhere with the MAD logging, but as far as I can tell the problem is not solved by this pull request.

#4 Updated by EOLE Team almost 5 years ago

Jaime Melis wrote:

We believe that the current code is OK. As far as we can tell: 2>&1 1>/dev/null means: 1) send stdout to devnull 2) send stderr to the old stdout. In other words, it should discard stdout and put stderr in stdout.

OK, I made the mistake with the order of the redirections, you can reject the pull request.

Can you let us know an example where the MAD is not logging properly? I agree there is a problem somewhere with the MAD logging, but as far as I can tell the problem is not solved by this pull request.

In comment #4298#note-12, I saw no occurrence of the logging of remote/datastore/fs/rm script (source:src/datastore_mad/remotes/fs/rm@e1f6dee1#L68):

  • in /var/log/syslog
  • in /var/log/one/oned.log
  • in /var/log/one/one_datastore.log

Strangely:

  • I have qcow2 Cloning $SRC_PATH in $DST log (source:src/tm_mad/qcow2/clone@60deea0e#L118)
    Fri Sep  2 13:53:18 2016 [Z0][ImM][I]: Cloning image /var/lib/one//datastores/101/0710ff6d3fcd678691336c08fad0106a to repository as image 14477
    Fri Sep  2 13:53:18 2016 [Z0][ImM][I]: Cloning image /var/lib/one//datastores/101/f3e58f2455586e7a10852700e8a33677 to repository as image 14478
    Fri Sep  2 13:53:18 2016 [Z0][ImM][I]: Cloning image /var/lib/one//datastores/101/7a13632b2ff37caec49ee37bf6cd58ae to repository as image 14479
    
  • but not the Generating context block device at $DST (source:src/tm_mad/common/context@e1f6dee1#L64).

Regards.

#5 Updated by Jaime Melis almost 5 years ago

  • Category set to Drivers - VM
  • Resolution set to fixed

Fixed

#6 Updated by Jaime Melis almost 5 years ago

  • Status changed from Pending to Closed

Also available in: Atom PDF