Cannot get array info for /dev/md0

When adding a disk back to an mdadm array I got this error for the md0 array which was actually my swap partition.

root@mothership2 ~ # mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: Cannot get array info for /dev/md0

To fix this you have to run:

mdadm --stop /dev/md0
mdadm --assemble --scan

Then you can add the drive to array like so:

mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: added /dev/sdb1
You have new mail in /var/mail/root