Air carrier pilot crew reported a track deviation; clearance deviation; caution terrain warning and improper loading of the SID in the FMC. The pilots both reported several runway changes and fatigue as contributing.
Synopsis
Air carrier pilot crew reported a track deviation; clearance deviation; caution terrain warning and improper loading of the SID in the FMC. The pilots both reported several runway changes and fatigue as contributing.
Narrative
It was the go home leg of a three day trip. I was PF and originally entered the flight plan departing runway XXR and the ZZZZZ departure. As we taxied to the runway we were cleared to runway XXL instead as a new ATIS was released and construction work began on XXR. While the CA taxied I updated the departure to runway XXL; but in a rush to reset the flight plan I did not re-enter the ZZZZZ RNAV SID. Once reaching XXL we were cleared for takeoff. On climb out I called FMS NAV at 400 feet and instead of indicating a left turn to 139 degrees the flight director started indicated a right turn direct towards ZZZZZ intersection farther along our cleared route. As the FD started indicating the right turn we had a brief terrain caution alert and we realized our mistake. The CA advised ATC immediately and they gave us a vector to correct the situation. Fortunately there was no conflicting traffic; we were light and had setup a no flex takeoff making for a rapid climb.Suggestions: Don't ever let yourself feel rushed. Always confirm your flight partner acknowledges changes made in the MCDU. Don't be afraid to call out fatigued.
Second reporter narrative
Departing ZZZ at night; we expected [Runway] XXR for departure; but on taxi out changed to XXL because of construction. I was taxiing and heads up because of the multiple runway crossings while FO changed the runway in the MCDU. I saw XXL as the runway but did not check to see that the SID was still there. It must not have been inputted again. We ran the change items and were ready to line up and wait immediately. During takeoff I was pilot monitoring. The FO called FMS NAV" at the appropriate time and I selected NAV; however the SID (ZZZZZ off XXL) was not in the box. It should have been a left turn but our course was pointed towards ZZZZZ which was right. The FO began I right turn. I realized something was wrong but not what. I said fly straight and then turn left while I was trying to put the ZZZZZ [SID] in the box. I then checked on with departure and told them we made a mistake but were in a left turn. They gave us a 090 heading to fly and then direct to ZZZZZ1. ATC asked us if we needed assistance. I explained that the SID dropped out and we turned the wrong way. At some point during the confusion we got a GPWS terrain caution "terrain terrain" along with a "appch 2 not avail" EICAS message. It stopped before we could respond; I think as we were turning back left. I don't know how close we were to buildings or terrain. The flight continued without further incident.I need to make sure during a runway change on taxi out that the SID is still entered in the mcdu. It is easy to forget to input again when changing runways; and easy to forget to verify when I'm busy taxiing. Contributing to this was my fatigue. The night before I was reassigned to a deadhead that arrived in ZZZ1 at XA:30AM. I was sent to 2 different hotels that did not actually have rooms for me; then scheduling told me to take a rideshare to a hotel 25 minutes away and that I had to put it on my own credit card. I did not get into bed until after XD:30AM. I thought I got enough rest but I was most likely stressed and fatigued. In hindsight it might have been prudent for me to call in fatigued."
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.