Technology Blog

Magento Order emails not being sent out, but others are

by on Jun.02, 2015, under Magento, Web Development

So we had a customer call in today saying that order notification emails for their site were not going out.  They run on Magento 1.9.1 which has implemented a new email queue system for magento.  They receive about 100-1,000 orders a day, which can mean several thousand emails, since each order gets several emails post order (order confirmation, order update, order shipping/tracking number, follow up email).

So the first thing I did was place a test order on production.  I did not receive the email.  I looked in the /var/log/messages for the server and searched for my email address.  It was not in there.  I did notice other email’s in there, including the account creation email, which I almost dismissed to the client as the order email.  This email is not queued like the order emails so it immediately gets sent out.

So this was a bit scary, not seeing the email in the system /var/log/messages then I remembered about the queuing Magento has, and that it runs from cron.  I looked for a locked up cron by doing ps aux |grep cron but nothing came up.  It looked like no cron was locked.  I then remembered the client had AOE Scheduler installed.  I browsed to system->scheduler->list view.

In the table we had to select core_email_queue_send_all and click on the search button.  This limits the table view to this value.  I had something like 28 results found, but my view filter was set to show 25 at a time.  So I could not see the trouble 3 at the end.  I switched to show the view at 50 which showed me all of my results and I noticed the last item was a “RUNNING” process from several days ago.  There were a few “MISSED” processes before it.

I then selected the RUNNING row and selected “kill” from the actions window.  It then said it would kill on the next cron run.  This meant that I had to wait two minutes to check back.  I checked back and it was still there.  I then selected the row and clicked on “delete” from the action drop down and this immediately removed the row.  I waited two minutes and refreshed the page and it was now running.  I also started noticing through mailgun that the emails were sending but I didn’t get mine.  This is because the most emails magento will process in one cron is 100.  This means if you have 3,000 in queue, it will take 30 minutes to get them all out.

 

You may also need to do this with newsletter_send_all.

Leave a Comment more...

Git – Revert Commit Already Pushed to a Remote Repository

by on May.14, 2015, under Uncategorized

Delete the last commit

Deleting the last commit is the easiest case. Let’s say we have a remote mathnet with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the mathnet remote repository to the parent of dd61ab32:

$ git push mathnet +dd61ab32^:master
Where git interprets x^ as the parent of x and + as a forced non-fastforward push. If you have the master branch checked out locally, you can also do it in two simpler steps: First reset the branch to the parent of the current commit, then force-push it to the remote.

$ git reset HEAD^ --hard
$ git push mathnet -f

 

Originally taken from Christoph Copied here for reference.

 

For NYC Web Design check out the link.

Leave a Comment more...

check_mk qmail-stat not working with plesk

by on Jan.26, 2015, under Linux, Plesk

I saw the check_mk added the ability to monitor the qmail mail queue, so I wanted to get that setup on a few plesk servers. The auto inventory wasn’t seeing the qmail and therefore wasn’t adding the check. It turns out that two things were wrong:

  • I updated the check_mk agent on the plesk server, but didn’t update the check_mk software on the nagios host. I needed to install the latest version in BOTH places to get it working.
  • Plesk uses its own paths, so we had to symlink /var/qmail/bin/qmail-qstat to /bin/qmail-qstat

ln -s /var/qmail/bin/qmail-qstat /bin/qmail-qstat

I spent way too much time figuring that out. Hopefully this post will help the next poor soul!

Leave a Comment more...

Find Databases created outside of Plesk

by on Sep.10, 2014, under MySQL, Plesk

So today I needed a quick script to list all of the mysql databases on the system and compare that to the databases that were created inside of plesk. I wanted to print any databases that were created outside of plesk.

Why you might ask? It came to my attention that some of our system admins were creating databases manually through command line and setting up users that way when doing code deployments onto our shared plesk servers.

Whats wrong with that? Well if the database is outside of plesk, then plesk backup system, and plesk migration manager won’t know about the databases, nor the db users/passwords. This means if you are relying on plesk backup xml, or plesk migration manager for your server upgrades or disaster recovery, you’re going to have an issue with missing databases at some point!

The code is simple and is below. From memory it should work on plesk 8-11 and I have tested it on v10/11 myself.

Next to add to the list, is to set this up as a cron and email our general support queue if a new db is created outside of the plesk system.

To install / run, copy the below into a file called db_checker.php, then at a command line run “php db_checker.php”. You will need to be the root user to run this script.

Leave a Comment more...

Varnish log by Client IP address

by on Mar.15, 2013, under Uncategorized

varnishlog -c -m ‘ReqStart: xx.xxx.xx.xxx’

Leave a Comment more...

No /etc/crontab on centos 6

by on Feb.14, 2013, under Uncategorized

CentOS 6.x has changed how the default system maintenance cronjobs are scheduled. These are the cron jobs responsible for things like rotating logs and indexing files on the filesystem. That is routine jobs that are best scheduled to run at off peak times when the server is not busy doing more important things like serving money making websites. So how do you go about changing the timing of cron jobs on CentOS or RHEL 6.x?

Or if you want more fine grained control you could just ditch anacron altogether and use /etc/cron.d/dailyjobs

yum remove cronie-anacron
yum install cronie-noanacron sysstat

service crond start
chkconfig crond on

Leave a Comment more...

Svn Ignore Multiple Folders

by on Dec.04, 2012, under Uncategorized

If you need to ignore multiple folders in svn an easy way to do it is with:
svn propedit svn:ignore .

If you receive the below message:
None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set

Try this:
vi ~/.bash_profile

and insert this line:

export SVN_EDITOR=vi

Note: This won’t work if the directory is already “in” svn. svn rm –keep-local dirname first.

Leave a Comment more...

Dell Poweredge Server 2950 with PERC 5i Raid Controller Keeps Loosing Hard Drive in Array (Foreign Config)

by on Nov.19, 2012, under Uncategorized

So I had an odd issue with a dell poweredge 2950 server with 5 hard drives in it. They were Hitachi drives 2TB each. I would format the server and use software raid to create a raid 5. Upon turning off the server and booting back up one of the hard drives would be “removed” from the array.

I later realized a complete off shutdown -h now and a cold start were how to reproduce the issue.

I realized that hitachi had a firmware update for my hard drives since they had an issue in some 3ware controllers. My controller a perc 5i is a dell re-branded LSI controller – so I gave it a shot anyway. After flashing the drives I had the same result. I think you should flash the drives to bring them up to date if you are reading this.

What the actual cause of the issue was; I only plugged in one of the two redundant power supplies for the server. In the past, we ran this server with 2 hard drives and had no issue with it being fully functional running on one of the two PSU’s. So when we un-racked the server and brought it to the office for this rebuild we only plugged in one PSU. After all outlets are valuable! Well I plugged in the second PSU into the other wall jack/strip (a different one – I didn’t even bother trying the same jack/strip) and I have not seen the drive go into a “removed” state yet.

So far I have concluded this was the issue. My conclusion is the fact the issue was consistent before and no longer occurs. The reason behind this I think is that these 2GB drives draw alot of power from the server – the initial boot from a cold state requires that the drives spin up. All 5 drives, all fans, and all cpu’s are drawing much more power than regular at the same time during the boot from a cold start. This must have been draining the 750w power supply with my server and causing the PERC 5i to not see one of the drives or to mark it as removed since it did not gain a response in adequate time.

Well that was a waste of about 16-20 hours of work – no I can begin installing the actual software on this machine knowing my raid will be reliable.

Leave a Comment more...

Installing php52 on centos 6

by on Nov.19, 2012, under Uncategorized

So, for some reason you need to install php 5.2 on centos6 (Ok Register Globals – because your client won’t pay for updating the software – right?)   So Here you go:     – Enable Atomicorp repo Run following command to enable Atomic YUM repo:

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

– Disable PHP 5.3 Atomic repo contains both PHP 5.2 and 5.3. Official RHEL/CentOS 6 repo also contains PHP 5.3. To disable PHP 5.3, add following line to YUM configuration file /etc/yum.conf:

exclude=php-*5.3*

– Install PHP packages Use following commands to install PHP 5.2 packages:
arch=$(uname -m)

yum install yum install php.$arch php-bcmath.$arch php-cli.$arch php-common.$arch php-dba.$arch php-devel.$arch php-embedded.$arch php-fpm.$arch php-gd.$arch php-imap.$arch php-intl.$arch php-ioncube-loader.$arch php-ldap.$arch php-mbstring.$arch php-mcrypt.$arch php-mhash.$arch php-mysql.$arch php-ncurses.$arch php-odbc.$arch php-pdo.$arch php-pear.$arch php-pecl.$arch php-pgsql.$arch php-process.$arch php-rspell.$arch php-recode.$arch php-snmp.$arch php-soap.$arch php-tidy.$arch php-xml.$arch php-xmlrpc.$arch php-zts.$arch php-sqlite.$arch -y

Here, machine architecture (e.g. x86_64 for Intel 64-bit architecture) is stored in the variable arch and its value is appended to each PHP package to avoid installing same package from multiple architectures. The list of PHP packages to be installed may vary depending on your requirements. If you do not know the correct name for a PHP package, search for PHP packages with following command:

yum search php

This command will list RPM packages having the string ‘php’ in their name along with a short description for each package.

Leave a Comment more...

List (LS) top biggest files or folders on linux file system

by on Sep.27, 2012, under Uncategorized

This command will list out the top biggest files or directories on the server.

resize; clear; date; echo "Largest Directories:"; du -hcx / | grep '^[0-9]*G'\
| sort -nr | head; echo ""; echo "Largest Files:"; nice -n 19 find / -mount \
-type f -ls|sort -rnk7 |head -10|awk '{printf "%d MB\t%s\n",($7/1024)/1024,$NF}'
Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...