Date: 201507
Local time of day: 0001-0600
Location: SFO.Airport, CA
Flight conditions: VMC
Light: Night
Aircraft: Commercial Fixed Wing
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Parked
Reporter organization: Air Carrier
Reporter function: Captain; Pilot Flying
Reporter qualification: Flight Crew Air Transport Pilot (ATP)
Human factors: Time Pressure; Fatigue
Second reporter function: First Officer; Pilot Not Flying
Anomaly: Aircraft Equipment Problem Less Severe; Deviation / Discrepancy - Procedural Published Material / Policy
Detector: Person Flight Crew
When detected: Pre-flight
Result: General Work Refused; General Flight Cancelled / Delayed
Contributing factors: Human Factors; Company Policy
Primary problem: Company Policy

Narrative: We had just completed a 90 minute flight segment that included a flight control malfunction; an irregular procedure; frustrating communications with dispatch due to a poor phone patch; burning down fuel to below maximum landing weight by flying an ATC vector box pattern for roughly 75 minutes; and a non-standard configuration landing.After takeoff our flaps failed to retract. We flew in an ATC vectored box pattern as we accomplished the irregular procedure and coordinated with the company; ATC; maintenance; and the cabin crew. After an uneventful landing we taxied to the gate and parked followed by normal after flight procedures; a thorough debrief with maintenance; and also representatives from the rescue/fire group.We were not aware of being reassigned a spare aircraft and continuing the flight until after we deplaned. We were told it was being preflighted and a new cabin crew had been called to the airport. At this point the FO and I found a quiet area where we could talk and accomplish a thorough post flight and self-evaluation. We were both very concerned that due to the irregular; waiting for a new crew; servicing the new aircraft; etc.; that there was a high probability that our alertness level at the end of the second segment would be quite poor and would adversely affect the arrival; approach; and landing. We discussed this for about 10-15 minutes; our discussion was thorough and included the desire to get our passengers to their intended destination. However we both reached the conclusion that the potential safety issues that would arise due to fatigue outweighed the desire to complete the flight. We informed the crew desk that we would not be able to continue without an intervening rest period.


Second narrative: We had a flight were we [had] a flap problem. The flaps on takeoff did not want to retract. We had to hold to burn off fuel because we were overweight for landing and the QRH procedure was pretty lengthy. It took an unusually long time to be able to communicate with dispatch and maintenance; due to us not being able to hear them well. They kept cutting out. After a while of [trying] we were able to finish communicating the problem with them. We finished getting the aircraft ready for the abnormal flaps 15 landing. When we got to the gate at XA:35; we were informed about having another airplane ready for us to take to ZZZ. And we would have our new flight attendants arrive [an hour later] and we would be [flying over night to] ZZZ. The captain and I discussed how we felt about continuing. We concluded that this malfunction required a high degree of concentration. Since it was an all nighter our alertness was and would be compromised if we continued. I felt that the safest course of action was to continue the next day.


Synopsis: Air carrier flight crew reported declining an all-nighter flight due to fatigue from an emergency on the previous leg which involved a lengthy procedure and delay.