Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with mirrorprobe mail handler #6

Closed
poeml opened this issue Jun 5, 2015 · 0 comments
Closed

issue with mirrorprobe mail handler #6

poeml opened this issue Jun 5, 2015 · 0 comments

Comments

@poeml
Copy link
Owner

poeml commented Jun 5, 2015

                                                                                                      [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue9

Title    issue with mirrorprobe mail handler
 Priority   bug     Status   resolved
Superseder        Nosy List  dfarning, poeml
Assigned To poeml  Keywords

msg21 (view) Author: dfarning Date: 2009-10-07.23:17:12

Peter here is a issues report on the mail handler.

mirrorbrain@Y650:/home/dfarning$ mirrorprobe
Traceback (most recent call last):
File "/usr/bin/mirrorprobe", line 334, in
main()
File "/usr/bin/mirrorprobe", line 216, in main
'root@' + socket.gethostbyaddr(socket.gethostname())[0],
socket.gaierror: [Errno -2] Name or service not known

I just commented out lines 214-222 in /usr/bin/mirrorprobe .

david

msg29 (view) Author: poeml Date: 2009-10-08.11:33:52

Hi David, I remember the email where you already mentioned this. I didn't read closely enough though.
I thought the error came from some mirror hostname. In fact, it is the machine name itself (of the
MirrorBrain host) that the script tries to resolve.

The lookup is done to have a hostname/domain to append to mailed logs; the feature of mailing logs
isn't actually used anymore, but the code is still there.

On my test host, the hostname "ubuntu" resolves to 127.0.0.1:

python -c "import socket; h = socket.gethostname(); print h; print socket.gethostbyaddr(h)"

ubuntu
('ubuntu', [], ['127.0.1.1'])

The code is obviously naively running on assumptions that can't be met everywhere.

Development plans for the mirrorprobe are:

  • integrate it into the "mb" tool, so there isn't the need to have a second script, and it can use
    shared functionality from the "mb" Python module
  • clean up its error reporting in general - it is a big neglected because it relied on the mail
    functionality in the past, and was run with &>/dev/null, which didn't turn out to be a good idea (rare
    errors could easily get lost)

Therefore, I'd think the code should be removed, and make place for a better notification mechanism. A
future notification system should be integrated with a web frontend, and allow for mail notification
at the same time, for important things.

I'll commit a fix in SVN, but as it will take a while until that ends up in the Ubuntu packages, I'd
recommend a workaround for now. Maybe you can adjust /etc/hostname and /etc/hosts in a way that it
avoids the crash - or comment out the code as you did.

This works here:

root@ubuntu:# cat /etc/hostname
ubuntu
root@ubuntu:
# grep ubuntu /etc/hosts
127.0.1.1 ubuntu
root@ubuntu:# python -c "import socket; socket.gethostbyaddr(socket.gethostname())[0]"
root@ubuntu:
#

(Returns empty value, but doesn't crash at least)

msg30 (view) Author: poeml Date: 2009-10-08.11:46:56

Fix committed with r7838. Will be included in the next release (post-2.10.1).

History
         Date           User   Action                    Args
2009-10-08 11:46:56 poeml    set    status: chatting -> resolved
                                      messages: + msg30
                                      status: unread -> chatting
                                      assignedto: poeml
2009-10-08 11:33:53 poeml    set    messages: + msg29
                                      title: issue with mail handler on ubuntu
                                      9.04 -> issue with mirrorprobe mail handler
2009-10-08 07:08:24 poeml    set    nosy: + poeml
2009-10-07 23:17:12 dfarning create

(end of migrated issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant