Any sort of obstruction in the sperm ducts, vas deferens, or urethra can prevent the sperm from being ejaculated. A common cause of infertility, blockages can be caused by infections (including sexually transmitted diseases), and can sometimes be repaired to restore fertility. A structural blockage may require surgery or some other procedure, while a blockage caused by infection may clear up with antibiotics and not need surgery. If the structural blockage cannot be repaired, then a testicular biopsy can be done to retrieve sperm.