Narrative:

VFR flight was planned when GPS malfunctioned midflight. I (pilot) was not able to figure out my position. I tried to fix the GPS issue; but it was unresponsive. I decided the best course of action was to immediately land at the nearest airport to correct the issue. While calculating my position utilizing dead reckoning; I spotted an airport with two runways. As I was unable to identify which airport I had in sight; I was unable to determine the airport's communications frequency. I descended and checked the windsock for a safe landing. I landed safely on runway 15. After I parked the airplane; I noticed several personnel in military uniform; and after speaking with a police officer; I realized that I was in a restricted area and a military base.the cause of the GPS failure is still unknown. After landing; and communicating the issue with my instructor; he recommended that I should have completely turned off the avionics to restart everything during the flight. I was concerned this might cause me to lose other systems; possibly communication. My best recommendation for correction of the issue in the future would be to practice an electronics/avionics failure and recovery during flight. Also; I should have filed the flight following for the unfamiliar area.

Google
 

Original NASA ASRS Text

Title: PA28R pilot reported a GPS failure with a subsequent penetration of a restricted area and an unauthorized landing at a military field.

Narrative: VFR flight was planned when GPS malfunctioned midflight. I (pilot) was not able to figure out my position. I tried to fix the GPS issue; but it was unresponsive. I decided the best course of action was to immediately land at the nearest airport to correct the issue. While calculating my position utilizing dead reckoning; I spotted an airport with two runways. As I was unable to identify which airport I had in sight; I was unable to determine the airport's communications frequency. I descended and checked the windsock for a safe landing. I landed safely on Runway 15. After I parked the airplane; I noticed several personnel in military uniform; and after speaking with a police officer; I realized that I was in a restricted area and a military base.The cause of the GPS failure is still unknown. After landing; and communicating the issue with my instructor; he recommended that I should have completely turned off the avionics to restart everything during the flight. I was concerned this might cause me to lose other systems; possibly communication. My best recommendation for correction of the issue in the future would be to practice an electronics/avionics failure and recovery during flight. Also; I should have filed the flight following for the unfamiliar area.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.