TheGeekery

The Usual Tech Ramblings

MySQL: Error 127 when reading table

After today’s little hiccup, I noticed the random image in the top right of my page throwing an error message, something about ERROR_STORAGE_FAILURE. A little digging about, I stumbled across an error in the daemon.log file…

mysqld[4478]: 100112 20:31:04 [ERROR] Got error 127 when reading table g2_ItemAttributesMap

Fortunately, most of the times, this is relatively easy to resolve1.

mysql> USE mydbname;
mysql> REPAIR TABLE g2_ItemAttributesMap;
+----------------------+--------+----------+----------+
| Table                | Op     | Msg_type | Msg_text |
+----------------------+--------+----------+----------+
| g2_ItemAttributesMap | repair | status   | OK       | 
+----------------------+--------+----------+----------+
1 row in set (0.01 sec)

As you can see from the Msg_text column, the command completed OK. A quick refresh of the blog page, and the error is now gone, and the random picture is back…

  1. If not, I have backups 

Friday night riddle...

What do the following things have in common…

  • Shipping Containers
  • Submarine Diesel Engines
  • Rope Bridge
  • Van de Graff “silo”
  • 660 lb fly wheel

No idea yet? Maybe this will help. Click on the videos at the top, watch each one. Very cool stuff…

PowerShell; Changing startup properties of a service

Windows 2008 doesn’t have SMTP as part of IIS any more. It’s only kept around by shipping the IIS 6 libraries with it, which means it’s managed by the old IIS 6 utilities. We installed SMTP so that our web servers had a relaying agent so if there were any delays talking to the main SMTP server the app wouldn’t crash out. The problem is, the default setting is for the SMTP service to be set to a manual startup, rather than Automatic. This is easily remedied by going through the services management utilities, or powershell one liner…

gwmi win32_service | ?{$_.name -like "*SMTP*"} | %{$_.changestartmode("Automatic")}

This is actually 3 steps. The first step connects to WMI and fetches all the services. The second limits the scope to just services with SMTP in the name. And the third is using the returned object and changing settings.

When run, a buunch of data is returned telling to the state of the command:

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0

You can verify that the command worked properly by looking at the ReturnValue, or by running the command again, but without the set step…

ExitCode  : 0
Name      : SMTPSVC
ProcessId : 7024
StartMode : Auto
State     : Running
Status    : OK

Running this command on a 2008 server is about 10 times faster than waiting for the services utility to open.

PowerShell and signing

I have an awful memory, so this is more a bookmark for me than anything. Whilst running home grown scripts for PowerShell, you often see the following error:

File C:\scripts\test.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-
help about_signing" for more details.
At line:1 char:19
+ c:\scripts\test.ps1

This is because PowerShell expects the script to be signed (something I have to look into). But as I’m doing basic scripts, you can disable this by using the following command:

Set-ExecutionPolicy RemoteSigned

You can get more details on this by using the following:

Get-Help About_Signing

More BBC funnies...

I mentioned a while back that BBC has an odd way of putting headlines. Whilst the body isn’t funny, the way the title was announced seems a little zombie like…

Severed hand attack victim dies

Was she attacked by a severed hand? Sadly no, full story is here, but the title makes it seem like she was.

Microsoft Jet DB and x64 platforms

Whilst doing the datacenter migration, we decided to upgrade all of our servers at the same time. It was less of a migration, and more of a new install, new location. We upgraded from Windows 2003 x86 platforms, to Windows 2008 x64 platforms. During the migration, we’ve stumbled across some issues…

Been a while...

It really has. I’ve not posted anything since August. Not from the lack of things to post, but lack of motivation, as well as too much work stuffs to contend with. I plan on remedying this issue over the next few days/weeks. Unlike some who vouch to post daily (which I know I cannot without driveling crap everywhere), I’ll work on maybe once a week with stuff I’m working on.