Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::__construct

While editing user details in “User Manager” in Joomla back-end, you may get the following error message.

Fatal error: Uncaught exception \\\’Exception\\\’ with message \\\’DateTime::__construct() [<a href=\\\’datetime.–construct\\\’>datetime.–construct</a>]: Failed to parse time string (24/05/1995) at position 0 (2): Unexpected character\\\’ in /home/cpaneluser/public_html/libraries/joomla/utilities/date.php:149 Stack trace: #0 /home/cpaneluser/public_html/libraries/joomla/utilities/date.php(149): DateTime->__construct(\\\’24/05/1995\\\’, Object(DateTimeZone)) #1 /home/cpaneluser/public_html/libraries/joomla/factory.php(452): JDate->__construct(\\\’24/05/1995\\\’, \\\’UTC\\\’) #2 /home/cpaneluser/public_html/libraries/joomla/html/html.php(573): JFactory::getDate(\\\’24/05/1995\\\’, \\\’UTC\\\’) #3 [internal function]: JHtml::date(\\\’24/05/1995\\\’) #4 /home/cpaneluser/public_html/libraries/joomla/html/html.php(187): call_user_func_array(Array, Array) #5 /home/cpaneluser/public_html/libraries/joomla/html/html.php(87): JHtml::call(Array, Array) #6 /home/cpaneluser/public_html/libraries/joomla/html/html.php(718): JHtml::_(\\\’date\\\’, \\\’24/05/1995\\\’) #7 [internal function]: JHtml::calendar(\\\’24/05/1995 in /home/cpaneluser/public_html/libraries/joomla/utilities/date.php on line 149

This is the error due to wrong date format used while adding/registering a new user.

To correct the issue, check related database name in “configuration.php” >> access PHPmyadmin in WHM >> Select proper database >> Search “24/05/1995” by selecting all the tables and edit related table accordingly and change the value “24/05/1995” to “24-05-1995”.

In most of the cases, the table will be “jos_user_profiles” so you need to edit “profile.dob” for respective user ID for which you are getting the error.

alarm level changed

Sometimes, you may get flooded with the email alerts like

alarm level changed.

This is an alert sent by plesk as a result of low values set for the Health Monitor.

To resolve the issue, you can download the Health Monitor configuration file in .xml format on your local PC and edit the values as below.

<service name=”Web” monitor=”true”>

<alarm level=”red” threshold=”25″ type=”percent”/>

<alarm level=”yellow” threshold=”20″ type=”percent”/>

</service>

 

and change it as per the limits you want to set.

 

<service name=”Web” monitor=”true”>

<alarm level=”red” threshold=”60″ type=”percent”/>

<alarm level=”yellow” threshold=”50″ type=”percent”/>

</service>

Save it and re-upload it to the server.

Or from command line, you will have to edit the following file.

# /usr/local/psa/var/custom-health-config.xml

Edit the values, save it and check the Health Monitor in plesk, it should be fine now.

domain.com exceeded the max records and failures per > hour (5/5 (%)) allowed. Message discarded.

In cPanel 11.32, a new feature is added to limit the ability of exploited or hacked sites to send out spam emails. A few customers who send out mass mailings have been triggering this feature, due to the number of bad/undeliverable email addresses on their lists.

Due to this feature you may get the following bounce back.

“Domain has exceeded the max defers and failures per hour (5/5 (26%)) allowed. Message discarded.”

cPanel will regularly monitor the emails sent through all email accounts on your domain, and if, over the past hour, more than 25% of the attempted deliveries have failed, outbound email will temporarily be limited.

To solve the issue,remove following file.

/var/cpanel/email_send_limits/max_deferfail_domain.com

and restart the exim service or you may need to disable the option “Ratelimit incoming connections with only failed recipients” in tweak Settings in WHM. If you still have an issue with this, in Tweak settings, change the value for “Maximum percentage of failed or deferred messages a domain may send per hour”. The option is used for the maximum percentage of a domain’s outgoing mail that can consist of failed or deferred messages. Once the domain exceeds this percentage, it is temporarily blocked from sending mail.

If you’re not sure exactly what is causing this, you can probably figure it out by using the Email Trace icon in your hosting control panel. When you click the Email Trace icon, you’ll see a field where you can enter a recipient’s email address and then click a “Run Report” button to get information about email sent to that recipient. If you enter nothing for the recipient email address, you’ll get back data for all email traffic, and as you look through it you should see groups of bounced messages which can help you determine what sender caused the problem, and why.

Unable to load object of type IPAddress with id=1: Table->select() failed: no such row in the table

While adding a new domain or add an IP address to a client you may get the following error.

ERROR: PleskFatalException

Favorites

Visited Pages

Unable to load object of type IPAddress with id=1: Table->select() failed: no such row in the table

0: common_func.php3:3159

objectMakerEx(string ‘IPAddress’, integer ‘1’)

1: IPPoolManager.php:968

IPPoolManager::toString(integer ‘1’)

2: indicator-ip.php:22

plesk__indicator_ip->renderHtml()

3: IndicatorUIPointer.php:13

IndicatorUIPointer->accessItem(string ‘INDICATOR’, NULL null)

4: UIPointer.php:596

UIPointer->access(string ‘INDICATOR’)

5: DashboardElement.php:1582

DashboardElement_indicator->renderHtml(object of type UserAdmin, NULL null)

6: DashboardElement.php:680

DashboardElement->renderHtml_indicators(array, object of type UserAdmin, NULL null)

7: DashboardElement.php:634

DashboardElement->renderHtml_common(array, object of type UserAdmin, NULL null)

8: DashboardElement.php:991

DashboardElement_top->renderHtml(object of type UserAdmin, NULL null)

This is because plesk tries to check the IP which is not in the IP Address Pool or which is not removed properly or unknown IP. To resolve the issue, you will have to find that IP and remove it from the server.

# mysql -uadmin -p'cat /etc/psa/.psa.shadow' -Dpsa

You will see the list of id numbers in the first column followed by the addresses in the second column.

Perform the modification of the component_id table as,

mysql> select id,ip_address from IP_Addresses;
 +----+----------------+
 | id | ip_address |
 +----+----------------+
 | 6 | 192.168.0.2 |
 | 7 | 192.168.0.3 |
 | 8 | 192.168.0.4 |

In above output the IDs are 6,7 and 8. Its supposed to be 1,2 and 3. To change the IDs

mysql> update IP_Addresses set id=1 where ip_address='192.168.0.2';
 Query OK, 1 row affected (0.01 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 mysql> update IP_Addresses set id=2 where ip_address='192.168.0.3';
 Query OK, 1 row affected (0.00 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 mysql> update IP_Addresses set id=3 where ip_address='192.168.0.4';
 Query OK, 1 row affected (0.01 sec)
 Rows matched: 1 Changed: 1 Warnings: 0
 Confirm the ID changes by
 mysql> select id,ip_address from IP_Addresses;
 +----+----------------+
 | id | ip_address |
 +----+----------------+
 | 1 | 192.168.0.2 |
 | 2 | 192.168.0.3 |
 | 3 | 192.168.0.4 |

now, check the plesk, it should be working fine. 🙂

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

After upgrading Magento to Magento 1.6.0.0, you may get the following message on Front-end AND Back-end:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

In the release notes there’s a reference to this issue:

“If you see the Service Temporarily Unavailable page after refreshing the frontend, open the Magento installation directory on the server and remove the maintenance.flag file. Then go to Magento var directory and remove the cache directory”.

[email protected] [/home/xxxxxxx/public_html]# mv maintenance.flag maintenance.flag.bk

Or

[email protected] [/home/xxxxxxx/public_html]# rm -rf maintenance.flag

[email protected] [/home/xxxxxxx/public_html]# cd var/cache

[email protected] [/home/xxxxxxx/public_html/var/cache]# ll

total 72

drwxrwxrwx 12 xxxxxxx xxxxxxx 4096 Aug 7 20:55 ./

drwxr-xr-x 10 xxxxxxx xxxxxxx 4096 Aug 7 20:30 ../

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–0/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–4/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–6/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–8/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–a/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–b/

drwxrwxrwx 2 xxxxxxx xxxxxxx 20480 Aug 7 20:55 mage–c/

drwxrwxrwx 2 xxxxxxx xxxxxxx 12288 Aug 7 20:55 mage–d/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–e/

drwxrwxrwx 2 xxxxxxx xxxxxxx 4096 Aug 7 20:55 mage–f/

[email protected] [/home/xxxxxxx/public_html/var/cache]#rm -rf mage*

Now, refresh the page and check the website. It should be working fine now.

How to disable the email alerts for a cronjob

There are 2 ways to prevent cron to send out e-mail notifications once the cron is executed:

01. Simply append one of the following directives to the end of your script to be executed.

so the cronjob will look like the following

* * * * * command /path/to/the/file >/dev/null 2>&1

or

* * * * * command /path/to/the/file &> /dev/null

Save and close the file. Restart the crond:

# /etc/init.d/crond restart

Or

02. By editing the MAILTO variable in the cronjob

# crontab -e -u username

MAILTO=””

Save and close the file.

# /etc/init.d/crond restart

/bin/rm: Argument list too long.

If you try and use ‘rm -rf’ you’ll generally get this error:

/bin/rm: Argument list too long.

So, let’s do it differently. We’ll use ‘find’ to find every file and pass it only ‘rm’ like so:

find . -type f -exec rm -v {} \;

This will delete the files.

database error for horde and roundecube

Sometimes you may face the following errors in webmail.

horde : A fatal error has occurredDB Error: connect failed

roundcube: DATABASE ERROR: CONNECTION FAILED!Unable to connect to the database!

Most probably, its an issue with the databases associated with horde and roundcube, so please check related error logs by

# vi /var/cpanel/horde/log/horde_0.log

Press Shift+G and check the error at bottom.

Feb 27 03:16:06 HORDE [emergency] [horde] DB Error: connect failed:  [nativecode=Access denied for user ‘horde’@’localhost’ (using password: YES)] ** mysql(mysql)://horde:[email protected]+localhost:3306/horde?persistent=1&charset=utf-8&ssl=1&splitread= [pid 18142 on line 398 of “/usr/local/cpanel/base/horde/lib/Horde/Perms/sql.php”]

# vi /var/cpanel/roundcube/log/errors

Press Shift+G and check the error at bottom.

[27-Feb-2012 03:15:09 +0000]: DB Error: _doConnect: [Error message: Access denied for user ’roundcube’@’localhost’ (using password: YES)]
[Native code: 1045]
[Native message: Access denied for user ’roundcube’@’localhost’ (using password: YES)]
** mysql(mysql)://roundcube:[email protected]/roundcube in /usr/local/cpanel/base/3rdparty/roundcube/program/include/rcube_mdb2.php on line 102 (GET /cpsess7853727673/3rdparty/roundcube/index.php)

The issue can be resolved by forced update

# /usr/local/cpanel/bin/update-horde –force
# /usr/local/cpanel/bin/update-roundcube –force

Once update completed, check the webmail.

You are done!

Plesk default config and logs files

The exact value of path variables can be known from /etc/psa/psa.conf file on Parallels Plesk Panel server. Below is example of /etc/psa/psa.conf file:

# Plesk tree

PRODUCT_ROOT_D /usr/local/psa

# Directory of SysV-like Plesk initscripts

PRODUCT_RC_D /etc/init.d

# Directory for config files

PRODUCT_ETC_D /usr/local/psa/etc

# Virtual hosts directory

HTTPD_VHOSTS_D /var/www/vhosts

# Apache configuration files directory

HTTPD_CONF_D /etc/httpd/conf

# Apache include files directory

HTTPD_INCLUDE_D /etc/httpd/conf.d

# Apache binary files directory

HTTPD_BIN_D /usr/bin

#Apache log files directory

HTTPD_LOG_D /var/log/httpd

#apache startup script

HTTPD_SERVICE httpd

# Qmail directory

QMAIL_ROOT_D /var/qmail

# Location of qmail maildirs

QMAIL_MAILNAMES_D /var/qmail/mailnames

# Path to rblsmtpd

RBLSMTPD /usr/sbin/rblsmtpd

# Courier-IMAP

COURIER_IMAP_ROOT_D /

# Proftpd

FTPD_CONF /etc/proftpd.conf

FTPD_CONF_INC /etc/proftpd.include

FTPD_BIN_D /usr/bin

FTPD_VAR_D /var/run/proftpd

FTPD_SCOREBOARD /var/run/proftpd/scoreboard

# Bind

NAMED_RUN_ROOT_D /var/named/run-root

# Webalizer

WEB_STAT /usr/bin/webalizer

# Logrotate

LOGROTATE /usr/local/psa/logrotate/sbin/logrotate

# MySQL

MYSQL_VAR_D /var/lib/mysql

MYSQL_BIN_D /usr/bin

# PostgreSQL

PGSQL_DATA_D /var/lib/pgsql/data

PGSQL_BIN_D /usr/bin

# Backups directory

DUMP_D /var/lib/psa/dumps

# Mailman directories

MAILMAN_ROOT_D /usr/lib/mailman

MAILMAN_VAR_D /var/lib/mailman

# Python binary

PYTHON_BIN /usr/bin/python2.4

# Tomcat root directory

CATALINA_HOME /usr/share/tomcat5

# DrWeb

DRWEB_ROOT_D /opt/drweb

DRWEB_ETC_D /etc/drweb

# GnuPG binary

GPG_BIN /usr/bin/gpg

# Tar binary

TAR_BIN /bin/tar

# Curl certificates

CURL_CA_BUNDLE_FILE /usr/share/curl/curl-ca-bundle.crt

# AWStats

AWSTATS_ETC_D /etc/awstats

AWSTATS_BIN_D /var/www/cgi-bin/awstats

AWSTATS_TOOLS_D /usr/share/awstats

AWSTATS_DOC_D /var/www/html/awstats

# openssl binary

OPENSSL_BIN /usr/bin/openssl

LIB_SSL_PATH /lib/libssl.so.5

LIB_CRYPTO_PATH /lib/libcrypto.so.5

CLIENT_PHP_BIN /usr/local/psa/bin/php-cli

Source

32bit or 64bit system check

To get the details, you can use following commands

# uname -a
# uname -i
# uname -m
# uname -p
# grep flags /proc/cpuinfo
# file /usr/bin/file
# cat /proc/cpuinfo
# getconf LONG_BIT

x86_64 GNU/Linux indicates that you’ve a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel.