Tuesday, April 30, 2013

Workaround: ThinkPad docking station USB ports fail after dock

My current work PC is a Lenovo ThinkPad T530 running Windows 7.  I’m using it with a Lenovo ThinkPad docking station, the “Thinkpad Mini Dock Plus Series 3 with USB 3.0”. 

Occasionally, when I re-dock the PC, some or all of the USB 2.0 ports in the docking station do not “turn on” and work properly.   This most obviously manifests in my USB keyboard and/or mouse plugged into the docking station not working.  The keyboard’s indicator lights (Num Lock / Caps Lock / Scroll Lock) won’t turn on, and the red laser light on the underside of the mouse doesn’t come on.

Removing and re-inserting the keyboard and mouse USB cables into the docking station does not fix the issue.

The workaround that I found that does work (under Windows 7) is as follows:

  1. Open Device Manager.  (From the Start menu’s Run field, type “device manager” and press Enter.  Obviously, use the laptop’s onboard keyboard and mouse if the external keyboard and mouse aren’t working.)
  2. Scroll down to the bottom of the Device Manager window, and click on “Universal Serial Bus Controllers” to expand it.
  3. Right-click on the first entry in the expanded list named “USB Root Hub,” and select Disable from the context menu.
  4. Right-click once again on that same “USB Root Hub” entry, and select Enable from the context menu.

If it works, the list of items under “Universal Serial Bus controllers” should refresh, and you should see some additional items in the list.  The USB ports on the docking station and devices connected to them should be working once again.

I’ve never had the single USB 3.0 port on the docking station fail to work in this way, so another workaround might be to attach an external USB hub to that port, and plug all external USB devices into the hub.

I did try replacing the docking station with another copy of the same model, but the intermittent issue persisted, so the issue appears to be with the PC software or hardware itself, not with the docking station alone.

This workaround is inconvenient, but it beats rebooting!  Let me know if you know of a better workaround or a fix.

Wednesday, April 17, 2013

Mac Impressions - The First 60 Minutes

What follows is something a little bit different: For your amusement, a somewhat steam-of-conciousness recounting of my first 60 minutes with a Mac Mini (purchased for the purpose of doing some on-the-side iOS development), from my background as a guy with 25+ years of DOS/Windows experience (dating back to doing BASIC development on an IBM PC my Dad brought home from work when I was 6 years old!) and some limited Unix/Linux experience, but no real Mac experience at all. Enjoy!

8:01 - Successfully booted up! Logitech mouse and "brand X" USB Windows keyboard (in use temporarily until next reboot, when I'll try my PS/2 IBM Model M keyboard with an adapter) appear to be working!

8:03 - Using Safari... the mouse scroll direction is backwards! I can't cope with that, Googling for a fix... okay, fixed it in System Preferences | Mouse.

8:06 - Some keyboard shortcuts use Win (Command)! Some still use Ctrl (Ctrl+Tab to switch browser tabs!) Confusing! A lot to learn!

8:11 - Keyboard document navigation is different!
- “Move one word at a time” now uses Alt (Option), not Ctrl!
- What’s the shortcut to jump to the beginning or end of a document?

8:14 - Middle-click doesn’t close tabs in Safari!
- Maybe I’ll switch to Firefox later. But going to stick out the “native experience” for now.
- Also, where are the favicons on the tabs? Hard to tell them apart.

8:17 - Ctrl+Tab doesn’t use MRU order in Safari!
- To be fair, no other browser gets this right either by default except Opera. Will be a deal-breaker though if it turns out that there’s no workaround, just like Chrome.

8:23 - Woah - Ctrl+LeftArrow takes me to some other desktop that shows a calendar and a calculator and some other stuff! (Hit that by accident trying to navigate within some text in an editor!)

8:27 - Looking through system preferences, Ctrl+UpArrow = Mission Control apparently! Seems like an interesting Alt+Tab (er, Cmd+Tab) alternative?

8:30 - Mouse button 4 (thumb button) doesn’t go Back in Safari! Is there a way to make that work?

8:32 - Some things are somewhat familiar from iPod Touch, e.g. Notifications Center and FaceTime.

8:35 - Safari seems bad at suppressing popup windows? Or maybe I’m just wandering into more “grey” parts of the Internet as I’m trying to look up things like keyboard shortcuts and haven’t learned yet which sites have good Mac info? But I've seen at least 2 spammy-looking popup windows show up in front of me so far.

8:37 - Thinking about security as I'm having to type in a couple of my passwords... How do I know that this Mac isn’t running a keylogger? What’s the equivalent of Ctrl+Shift+Esc on this thing? (Just tried that; it didn’t do anything, nor did Cmd+Shift+Esc, not that I really expected it to. Maybe a good old command-line ps -ef is the answer, like in Linux... will need to learn what's "normal" on this system and what's not.)

8:38 - Ok, so how do I open a Terminal window? Searching Google... Aha, Cmd+Space is kind of an analog to Win+R (or just the Win key as of Windows 7) on Windows. Then I can just type “terminal” and hit Enter.

8:41 - Where’s the filesystem explorer? I remember that it’s called “Finder” on Mac. Poking around... Ah, I see, it’s activated from the smiley mac face at the far left of the “applications bar” thingy at the bottom of the screen.

8:42 - The Close button is in the top-left of each window, not top-right. Is there an Alt+F4 (universal “close window” shortcut key) on this?

8:45 - Talking to my wife on her iPhone via “Messages!” Man, this thing works flawlessly, unlike any solution that I’ve tried on a PC to chat with her on her iPhone. User experience is just like my iPod Touch. Impressed, but at the same time disappointed at that lack of a good PC solution for me to use at work; real keys (PC) blow away virtual ones (iOS device) every time.

8:48 - The Home and End keys don’t work in the Messages message entry field, but they do work in other places like Google Docs running in Safari -- what’s that about? They don’t seem to work in the Safari address bar either?

8:50 - Thinking ahead to writing up all this as a blog post. Is there an equivalent to LiveWriter on Mac? I'll probably just use the Blogger web UI for starters.

8:52 - Oh, found by accident that Cmd+UpArrow/DownArrow is like Ctrl+Home/Ctrl+End. Was trying to do that Ctrl+UpArrow thing to activate Mission Control to find out where my terminal window went. Don’t see it... I must have closed it. But now I also see that Cmd+LeftArrow/RightArrow act like Home and End.

8:56 - What’s Launchpad do... ah, seems reminiscent of the iOS desktop. *All* of the icons!

8:58 - No Menu key? Is there a “right-click” key on Mac to bring up spelling fixes when the caret is on a misspelled word, without reaching for the mouse?

9:00 - Typing in a Safari textarea field and typoed in “cusotmer” and Safari is showing a little popup with the suggested corrected spelling “customer” -- great! But how do I accept that correction without reaching for the mouse and clicking on it? Just pressing space bar like on iOS doesn’t seem to do the trick? I can’t seem to use the tab key to get to the little popup either? ... Ah, I need to hit DownArrow and then enter, ok.

...And there you have it, the highlights of my first 60 minutes as a Mac user! Maybe I'll come back to this topic and do a "Mac Impressions - The First 60 Days" and give some more in-depth impressions once I've gotten to spend some significant time with this new machine.

Finally, here's one bonus thought to leave you with:

10:40 - I must have hit "Home" and/or "End" at least 15-20 times as I was editing this post, and in the process discovered that those keys on a Mac apparently serve to scroll the viewport (but not the insertion point, thankfully) to the beginning or end of a long editable text area, respectively! The muscle memory from all those years of DOS and Windows is baked in pretty hard. It will be interesting to see how difficult it is to overcome that as I continue using this new Mac... at least *some* of the time already I'm remembering to use Cmd+Left/Right instead of Home/End, but it's far from 100% at this early stage!

Monday, April 15, 2013

ATG 10.1.2–“FileNotFound” error using Endeca search from an InvokeAssembler droplet

Issue

In Oracle ATG Commerce 10.1.2, a JSP page in my project failing to properly retrieve results from Endeca Guided Search.  (The application is not using Endeca Experience Manager).  The following error appeared in the ATG application log file:

**** Error      Mon Apr 15 09:55:55 EDT 2013    1366034155171   /atg/endeca/assembler/droplet/InvokeAssembler   A problem occurred assembling the content for content item /services/guidedsearch. The response received was {contentUri=/services/guidedsearch, @type=ContentInclude, @error=FileNotFound}. Servicing the error open parameter.

Resolution

The problem turned out to be not a missing file, but that some of the Endeca-related ATG components were misconfigured.  We resolved the problem by making sure that the following ATG component properties had correct values:

atg.endeca.ApplicationConfiguration

  • baseApplicationName
  • defaultApplicationName
  • keyToApplicationName
  • defaultLanguageForApplications
  • workbenchHostName
  • workbenchPort

atg.endeca.assembler.AssemblerApplicationConfiguration

  • defaultMdexHostName
  • defaultMdexPort

atg.endeca.assembler.cartridge.manager.DefaultWorkbenchContentSource

  • serverPort

atg.endeca.assembler.cartridge.manager.AssemblerSettings

  • experienceManager

Update August 7, 2013

My team today encountered this "FileNotFound" error again when setting up a new environment. Even after verifying the ATG configuration was 100% correct, the problem persisted. The Endeca JSP Reference Application ("orange application") also returned search results successfully, which demonstrated that the Endeca MDEX server cluster was working ok.

The fix turned out being that the promote_content.sh script located at endeca/apps/appname/control needed to be run. After running that script and having it report successful completion, ATG immediately starting being able to retrieve search results from Endeca successfully (no service restarts needed).

Tuesday, March 12, 2013

Diagnosis and fix of a “very slow PC” issue

Last September, my primary desktop PC at home (built 2008), running Windows 7 64-bit, started exhibiting a strange set of symptoms: The system would boot up normally, but after that, certain operations, particularly operations needing to read from the hard drive, would take far longer than normal.  For example:

  • Pressing Ctrl+S (Save) from Notepad would take a full minute to display the Save dialog, but the file would save normally after that;
  • Copying files between the two internal hard drives (C: and D:) worked, but took about 20x as long as normal;
  • Applications would sometimes take a very long time (1-2 minutes) to initially start;
  • The game “Torchlight 2” would start, but the “loading” screen would never go away, and the background music looped abnormally, playing the same segment of music over and over again every 5-6 seconds.
  • These problems would all seemingly get worse over time, until I rebooted the PC.

Not having run across an issue like this before, I tried quite a few different troubleshooting steps:

Troubleshooting Step Tried Outcome
Warm boot (restart the PC) No effect
Cold boot (power off and then power on the PC) No effect
Windows System Restore Failed, with a “Failure restoring registry” error
chkdsk /f (“Check disk” utility from the command prompt, with the “fix” parameter) Ran ok and reported no errors for either C: or D:
Ran the Windows built-in RAM diagnostic Ran ok and reported no issues
Virus scan with Microsoft Security Essentials Ran ok and reported no issues
Reseated hard drive SATA cables for both drives No effect

Killed various processes via Task Manager (suspecting a virus?)

No effect

Disconnected the D: drive (the non-boot data drive)

No effect
Booted into Safe Mode No effect – Slowness issue occurred even in Safe Mode

Ran System Restore from Windows bootable CD

Failed, same as when running System Restore from Windows itself

Finally, with other options exhausted, and uncertain whether the root cause might be a software issue with Windows itself, I took the extreme step of “repaving” the PC: Formatting the C: (boot drive) and reinstalling Windows 7.

Doing that actually did initially seem to solve the problem; Windows installed with no issues on the reformatted C: drive, and I was able to reinstall and use all of my applications – for a time.

Unfortunately, in January, the exact same issue suddenly started manifesting again.  The PC would boot ok, and run okay for a few minutes, but then suddenly certain operations like opening new applications or saving files would suddenly start taking far longer than normal.  Further, the problem started getting worse across reboots (as I ran through various troubleshooting steps), eventually to the point where Windows would hang while starting up.

This time, suspecting a hardware problem with the C: drive, I took a troubleshooting step that I hadn’t tried previously: I powered off the PC, disconnected the C: drive, and powered the PC back on.  Although I wouldn’t normally recommend running a PC this way, I actually had an old bootable install of Windows Vista sitting on the D: drive.  With the normal boot disk (C:) disconnected, D: became the boot disk, and the old Vista install booted right up.  (I also physically disconnected the PC’s network card before doing this, not wanting to run afoul of any potential 2013 security issues that a circa-2009 instance of Vista might not be equipped to handle.)

Playing with the Vista install running off the D: drive, I obviously couldn’t really test any non-trivial applications, but the Windows desktop itself was actually usable enough, and exhibited no signs of the slowness issue that the exact same PC configuration, except with the C: drive connected, had been showing.  From this, I tentatively concluded that the issue was a physical problem with the C: hard drive – one that my earlier chkdsk and other diagnostic measures targeted at the hard drive hadn’t picked up for whatever reason.

So I set aside the old, presumably bad, C: drive.  Then – figuring I might as well get a system upgrade out of this whole ordeal! – I ordered a speedy new hard drive, a Crucial m4 128GB 2.5-Inch SATA 6Gb/s Solid State Drive (SSD) (model CT128M4SSD2 - $116 on Amazon.com as of 3/2013), to serve as the new C: boot disk. 

Once the drive arrived, I connected it, once again installed Windows 7, re-installed my applications, and the system is once again running great!  It’s been about 2 months now since the second instance of the “slowness” issues happened, and not only have there been no signs of it returning, but the system now boots faster than ever with the new SSD serving as the boot disk.

I’ll update this post should the slowness issue ever return – but if you don’t see any updates to this post, you can assume that things are still running smoothly -- or that this PC was retired without this issue ever re-occurring!

Wednesday, January 02, 2013

Possible bug with Windows’ Save As dialog

This morning I ran across a minor bug with the Windows common “Save As” dialog.  I ran across the bug in the Chrome browser, and then was able to reproduce it using plain old Windows Notepad (notepad.exe).  Bugs like this in common Windows components are rare enough that I figured it was worth a quick blog post.

Steps to reproduce:

1. Open the Save As dialog for an application.  (In my example, I opened a file named “myfile.txt” in Notepad, then did File | Save As.)

2. Navigate to a directory that already contains a file with the same name as the file to be saved.

SaveAs

3. In the Save As dialog, create a new folder, e.g. by clicking the “New folder” button.

4. Still in the Save As dialog, drag the existing copy of the file to the new folder to move it there.

MoveFile

5. Click the Save button.

At this point, I would expect Windows to just go ahead and save the file.  However, at this point Windows puts up a “File already exists. Do you want to replace it?” confirmation message, as if the existing copy of the file had not already been moved out of the way.

Confirmation

This is only questionably a “bug,” since it doesn’t really hurt anything by happening, other than possibly causing some minor surprise/confusion on the part of the user, who may think they didn’t actually move the original copy of the file as they had intended. 

I assume this is happening because the dialog is doing some kind of caching of the contents of the destination folder at the time the folder is opened, and then not actually comparing against the actual contents on disk again at the time that the user clicks the Save button.

I encountered this on Windows 7 (Pro, 64-bit).  I’m not sure whether or not this also happens on other Windows versions.

Obviously this “bug” is not a big deal at all, but irrespective of the occasionally-questionable popular perception of the quality of Microsoft products, I find Windows 7 to be generally pretty rock-solid stable when it comes to basic day-to-day operations (as it should be), so I was surprised to observe this behavior.  I wonder if this is “working as intended,” or if Microsoft actually would consider this a bug?