Glycolaldehyde forms from many precursors, including the amino acid glycine. It can form by action of ketolase on fructose 1,6-bisphosphate in an alternate glycolysis pathway. This compound is transferred by thiamine pyrophosphate during the pentose phosphate shunt.
In purine catabolism, xanthine is first converted to urate. This is converted to 5-hydroxyisourate, which decarboxylates to allantoin and allantoic acid. After hydrolyzing one urea, this leaves glycolureate. After hydrolyzing the second urea, glycolaldehyde is left. Two glycolaldehydes condense to form erythrose 4-phosphate, which goes to the pentose phosphate shunt again.
Glycolaldehyde was identified in many other planets and also at the middle of the Milky Way. Although technically not sugar, the discovery of interplanetary glycolaldehyde has been reported in many publications as "sugar found in space".