A nationwide collapse of the US customs service computer system left thousands of passengers lined up at airports awaiting clearance to officially enter the country, the authorities and US media said.