1 (edited by broth 2012-04-22 00:58:49)

Topic: Error message when entering iRedMail-Pro Webpanel for the first time

==== Provide required information to help troubleshoot and get quick answer ====
- iRedMail version: iRedMail-Pro MySQL 1.3.1
- Linux/BSD distribution name and version: Debian Squeeze
- Any related log? Log is helpful for troubleshooting.
====

Hello!
Sometimes when I enter the webpanel, following error message is shown:

Error while checking new version: <urlopen error [Errno 111] Connection refused>

In further accesses to the server, the error message does not appear again.
I think the panel is checking for a new iRedMail version online.
For security reasons, my server has no direct internet access and a proxy configured (http_proxy environment variable):

declare -x ftp_proxy="http://10.1.15.16:3128"
declare -x http_proxy="http://10.1.15.16:3128"

IMHO the checking routine has to use the proxy server and/or parse the environment variable.
Is this planned or how can I make this work?

Best regards,
Bernhard

Post's attachments

Screenshot1.png
Screenshot1.png 7.14 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Error message when entering iRedMail-Pro Webpanel for the first time

broth wrote:

Error while checking new version: <urlopen error [Errno 111] Connection refused>

I think the panel is checking for a new iRedMail version online.

Indeed, it automatically check new version from iredmail.org.

Could you please try below patch? Let me know whether it works for you or not, so that i can commit it to next release. smile

diff -r 05f8bf93ffa1 admin/mysql/1.3.1/libs/iredutils.py
--- a/admin/mysql/1.3.1/libs/iredutils.py    Sat Apr 21 00:07:41 2012 +0800
+++ b/admin/mysql/1.3.1/libs/iredutils.py    Sun Apr 22 12:24:56 2012 +0800
@@ -420,6 +420,13 @@
 
     try:
         socket.setdefaulttimeout(5)
+
+        urllib2.install_opener(
+            urllib2.build_opener(
+                urllib2.ProxyHandler({'http': 'http://10.1.15.16:3128'})
+            )
+        )
+
         dom = parseXMLString(urllib2.urlopen(urlOfXML).read())
 
         version = dom.documentElement.getElementsByTagName('version')[0].childNodes[0].data

3

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Hello Zhang,

I implemented the patch in /usr/share/apache2/iRedAdmin-Pro-MySQL-1.3.1/libs/iredutils.py
but when I first entered the page, the same error message appeared.

How can I trigger manually the update check process?
AFAIK it's done only once a day, right?

Best regards,

Bernhard

4

Re: Error message when entering iRedMail-Pro Webpanel for the first time

broth wrote:

I implemented the patch in /usr/share/apache2/iRedAdmin-Pro-MySQL-1.3.1/libs/iredutils.py
but when I first entered the page, the same error message appeared.

Oops, looks the patch for http proxy setting doesn't work as expected.

I don't have a http proxy for testing, could you please try below python code?
http://stackoverflow.com/questions/1450 … th-urllib2

broth wrote:

How can I trigger manually the update check process?
AFAIK it's done only once a day, right?

It's designed to check automatically once a day. Please ignore this error before we get proxy working.

5

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Accorting to http://www.voidspace.org.uk/python/arti … lib2.shtml

urllib2 will auto-detect your proxy settings and use those. This is through the ProxyHandler which is part of the normal handler chain. Normally that's a good thing, but there are occasions when it may not be helpful [5]. One way to do this is to setup our own ProxyHandler, with no proxies defined. This is done using similar steps to setting up a Basic Authentication handler :

proxy_support = urllib2.ProxyHandler({})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)

I added this code to the iredutils.py

Now I would like to know how to trigger the update-check process manually.
Is the check run always at first login to iRedMail?

https://10.1.15.15/iredadmin/dashboard/checknew

Best regards,
Bernhard

6

Re: Error message when entering iRedMail-Pro Webpanel for the first time

broth wrote:

I added this code to the iredutils.py

Does it work? Could you share the source code you added/modified?

broth wrote:

Now I would like to know how to trigger the update-check process manually.
Is the check run always at first login to iRedMail?

It cannot be triggered manually, sorry.
It will check the first time you login to iRedMail in a day, which means, after checked, it won't check anymore in the same day.

7

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Here is it.
I will try tomorrow if it works.

--- iredutils.py    2012-04-23 17:32:46.590140781 +0200
+++ iredutils_mod.py    2012-04-23 17:32:24.290162445 +0200
@@ -421,6 +421,10 @@
     try:
         socket.setdefaulttimeout(5)
         
+    proxy_support = urllib2.ProxyHandler({})
+    opener = urllib2.build_opener(proxy_support)
+    urllib2.install_opener(opener)
+   
    dom = parseXMLString(urllib2.urlopen(urlOfXML).read())

         version = dom.documentElement.getElementsByTagName('version')[0].childNodes[0].data

8

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Today there was no error message but no logs in the proxy server.
Only clamav updates are working correctly via proxy (I guess they use wget which makes use of the http_proxy environment variable).

I was running

https://10.1.15.15/iredadmin/dashboard/checknew

some times but no result.
Where do you have the timestamp for the checking process saved? How do you check if the check was already done?

9

Re: Error message when entering iRedMail-Pro Webpanel for the first time

broth wrote:

Where do you have the timestamp for the checking process saved? How do you check if the check was already done?

If there's a record in SQL table 'iredadmin.updatelog', it won't check again. For example:

mysql> USE iredadmin;
mysql> INSERT INTO updatelog (date) VALUES ('2012-04-24');

Then it won't check it today (2012-04-24).

10

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Sorry, again the error message:

Error while checking new version: <urlopen error [Errno 111] Connection refused>

11

Re: Error message when entering iRedMail-Pro Webpanel for the first time

broth wrote:

Here is it.
I will try tomorrow if it works.

--- iredutils.py    2012-04-23 17:32:46.590140781 +0200
+++ iredutils_mod.py    2012-04-23 17:32:24.290162445 +0200
@@ -421,6 +421,10 @@
     try:
         socket.setdefaulttimeout(5)
         
+    proxy_support = urllib2.ProxyHandler({})
+    opener = urllib2.build_opener(proxy_support)
+    urllib2.install_opener(opener)
+   
    dom = parseXMLString(urllib2.urlopen(urlOfXML).read())

         version = dom.documentElement.getElementsByTagName('version')[0].childNodes[0].data

You don't have proxy server configured here. urllib2.ProxyHandler({}) should be:

urllib2.ProxyHandler({'http', 'http://10.1.15.16:3128'})

Or, try:

urllib2.ProxyHandler({'http', '10.1.15.16:3128'})

12

Re: Error message when entering iRedMail-Pro Webpanel for the first time

Hello Zhang,
according to the doc, an empty parameter should cause urllib to detect the proxy settings automatically (from the environment).
I'm not a python programmer so I don't know how/where to investigate further.
Why don't you try to instal a proxy by yourself?
"aptitude install squid" and then adjust "/etc/squid/squid.conf"
It's really easy.
Then you have to set the http_proxy variable to point to the proxy server
export http_proxy="http://127.0.0.1:3128"

Thats it. Monitor /var/log/squid/access.log for proxy requests.
Best regards,
Bernhard