Compilation fails due to "No upload port specified"

It is only absent when no ports were discovered. I have encountered a problem where it did not discover ports even though they were present, which is being tracked here:

As mentioned there, I find this issue to be intermittent, meaning that if I restart the IDE once or twice it will then show the ports. The port will also appear if I unplug and then replug the board while the IDE is running. If you try those things, do you get a port finally, or do you never get ports?

There is another report that seems to be the latter: