The problem is actually quite common throughout all camera brands. Usually it's sand or grit interfering with the lens extension mechanism. Or the camera's been dropped with the lens extended. Or the camera has been powered on, but the lens had been blocked preventing its extension. Or the battery ran down with the lens extended. Believe it or not, one BIG contributor to lens errors is using a camera case. Sand, gunk, case fibers, etc... accumulate at the bottom of the case. These materials love to cling to the camera by electrostatic build-up from the camera rubbing against the side of the case (especially those cases with soft fibrous intreriors). Once these materials work their way into the lens mechanism, that's all she wrote. I have many Canon's, and NEVER use a case for this very reason.
A camera owner that suffers this problem may have no recourse for having the camera repaired. Many camera makers will not honor repairing this problem under warranty as they claim it is due to impact damage to the camera, or sand or debris getting into the lens gearing mechanism (neither of which is covered under warranty). The quoted repair cost is usually close to or more than what the camera is actually worth.
Fortunately, about half the cameras that suffer this failure can easily be fixed by one of the following methods. None of these methods involve opening the camera, although some have potential to cause other damage to the camera if excessively done. If the camera is still under warranty, before trying any of these, please please first contact your camera's maker to see if they'll cover the repair, or to determine how much they'll charge for the repair. Who knows, you might get lucky. But if they quote you a number that's higher than the value of your camera, you may want to consider the following methods.
The methods are listed in the order of risk of damaging your camera. Thus make sure you try them in the listed order. And remember, these fixes (especially #6 and 7) should only be considered for a camera that's out of warranty, who's cost of repair would be excessive, and would otherwise be considered for disposal if unrepaired:
Fix #2: If the camera's batteries ran down completely while the its lens was still open, the camera may show a lens error or not start properly when new batteries are installed. Remove the memory card and keep it removed, then install the new batteries. When you turn the camera on with the card removed it may come back to life, as this triggers a reset in some cameras. Error E30 (for older Canon's) means that you don't have a memory card installed, so turn it off, slip in the SD card and turn it on one last time
Fix #3: Insert the cameras Audio/Video (AV) cable, and turn the camera on. Inserting this cable ensures that the camera's LCD screen remains off during the start process. Thus extra battery power is available to the camera's lens motor during startup. This extra power can be useful in overcoming grit or sand particals that may be jamming the lens. If the AV cable doesn't fix the lens error by itself, consider keeping this cable installed while trying fixes 4, 5, and 7 as a means to provide extra power to help to these fixes. But note that I DON'T recommend keeping the cable installed during Fix 6 as you may damage the AV port while tapping the camera. Reinsert the cable only AFTER tapping the camera.
Fix #4: Place the camera flat on its back on a table, pointed at the ceiling. Press and hold the shutter button down, and at the same time press the power-on button. The idea is that the camera will try to autofocus while the lens is extending, hopefully seating the lens barrel guide pins back into their slots.
Fix #5: Blow compressed air in the gaps around the lens barrels with the idea of blowing out any sand or grit that may be in there jamming the lens. Other variations include blowing with a hair dryer in “no heat” setting, or sucking the gaps with a vacuum (careful with this one). Some people also have actually used a "Shop Vac" with this fix to help extend a retracted lens.
Fix #5a: If you actually do notice sand particles stuck in the gaps around the lens barrel, and blowing air does not help to dislodge them, consider using a thin piece of paper or a sewing needle to help dislodge them. Pay particular care not to scratch your lens barrel with the needle. Also, I do not recommend probing too deeply around the lens barrel with the paper (don't go more than a 1 cm or 1/2 in) . Particularly I do not recommend probing deeply around the most outer (largest) lens barrel gap, as you may dislodge the lens barrel dust gasket that's located just inside of that gap.
Fix #6a: This is a variation of Fix #6, and should be tried if the lens barrels appears straight (not crooked). In other words, try this if there's no obvious mechanical damage to the lens barrels that's causing the problem. With the lens pointed down, try "gently" tapping around the lens barrels with a small item such as a pencil or a teaspoon. The idea is to try to dislodge any sand particles that may be jamming the lens barrel stuck. Simultaneously try turning the camera on and off as you're doing this.
Fix #7: The most extreme of the fixes. You especially mightconsider this if the lens barrel appears obviously damaged, bent, or crooked such as from a fall. Try forcing the lens. More people have reported success with this method than with any of the other methods (see the polls in the right column). HOWEVER, there's obviously some potential for damaging your camera by using this method. Variations include gently pulling, rotating, and/or twisting the lens barrel while hitting the power button. Attempt to straighten or align the barrel if it's crooked or twisted. Another variation includes looking for uneven gaps around the lens barrel, and then pushing on the side of the lens barrel that has the largest gap (note pushing the lens barrel all the way in is NOT recommended as it may become stuck there). While doing any of the above, listen for a click that indicates that the lens barrel guide pins may have reseated in their guide slots. If you hear this click, immediately stop and try the camera.
Symptoms of a Lens Error:--There are a number of ways in which your lens can display some sort of error. For some cameras, it might just make a beeping noise along with lens withdrawal, or sometimes the lens won't be able to move at all, or a message detailing the error might pop up on the LCD screen. Different cameras have different ways to warn a user about a lens error, so if your camera is malfunctioning in some way, it might be good to consult your camera's user manual.
Causes of a Lens Error:--There are a number of ways with which a lens error can be caused. Particulates might have managed to get into the mechanical bits that allow the lens to retract, a purely physical interference with the lens mechanism. If the camera was dropped, especially while the lens was extended, there's a pretty good chance something might have been knocked loose, such as the guide pins upon which the lens withdraws and retracts.
Lens Error Prevention
This is all after the accident, of course. There are some steps you can take to prevent a lens error from happening in the first place, saving both you and your camera a fair bit of hassle.
As protective as camera cases generally are, they're the number one way with which grit can get into a lens, one of the more common ways of causing a lens error. Make sure you thoroughly clean out your camera case on a regular basis—you'd be surprised how much dirt can accumulate!
Careful handling in general of your camera is a must. As common sense as it might seem, make sure not to drop the camera, especially while the lens is extended. Make a habit of utilizing either a neck or wrist band while using your camera—just to be safe.