Qantas appears to have a snake problem. For the second time this year a snake has been found trying to hitch a lift on a plane, this time forcing hundreds of passengers to spend a night in a Sydney hotel instead of jetting off to Japan.

About an hour before the 9.30pm QF21 flight to Tokyo's Narita airport was due to board, a small snake was discovered in the plane's doorway. At just 20cm long the Mandarin rat snake was not a worthy foe of Samuel L. Jackson but, given that there could have been others on the plane, the 370 passengers were put up at a Sydney hotel overnight.

"The snake was taken to quarantine to determine where it came from, and a replacement aircraft – a B747 – operated a replacement service to Narita this morning at 10.15," a spokeswoman told Guardian Australia.

The Department of Agriculture, which looks after quarantine matters, told Guardian Australia the snake had been identified as a Mandarin rat snake commonly found in Asia. It had been euthanised "as exotic reptiles of this kind can harbour pests and diseases not present in Australia", a spokeswoman said.

She praised the Qantas staff for their actions. "This find demonstrates the important collaborative efforts of Department of Agriculture and airport staff in identifying and containing serious biosecurity risks."

As to whether it was the only serpent on board, Qantas didn't take any chances. "They used another aircraft to operate that service and the existing B747 will be fumigated before re-entering service," the Qantas spokeswoman said.

She said she believed passengers had been made aware of the reason their flight was delayed.

It's the second time this year a snake has been found on a Qantas flight. In January passengers watched in horror as a 3m scrub python clung to the wing of their plane for two hours during a flight before it met a grisly end.