# Sketch upload problem and port duplication

**URL:** <https://forum.arduino.cc/t/sketch-upload-problem-and-port-duplication/591067>\
**Category:** Uploading\
**Created:** [May 11, 2019, 2:14pm UTC](https://forum.arduino.cc/t/sketch-upload-problem-and-port-duplication/591067 "2019-05-11T14:14:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shah253](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@shah253](https://forum.arduino.cc/u/shah253)\
**Post date:** [May 11, 2019, 2:14pm UTC](https://forum.arduino.cc/t/sketch-upload-problem-and-port-duplication/591067/1 "2019-05-11T14:14:01Z")

</div>

Please take a look at the image attached. I am not sure how this happened. The port number duplicated almost every time I plug the Arduino in. I tried re-launching the Arduino and re-install the IDE. The port number still there even though the Arduino is detached. I also cannot upload any sketch to any Arduino that I owned. (Mega, Uno, Nano)

 ![Arduino Problem.png](https://europe1.discourse-cdn.com/arduino/original/4X/0/1/d/01db4f7db4b62e4e75210ae43e9633cc72bcca7e.png)

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [May 12, 2019, 11:02am UTC](https://forum.arduino.cc/t/sketch-upload-problem-and-port-duplication/591067/2 "2019-05-12T11:02:18Z")

</div>

shah253's picture:

 ![Arduino Problem.png](https://europe1.discourse-cdn.com/arduino/original/4X/0/1/d/01db4f7db4b62e4e75210ae43e9633cc72bcca7e.png)

The duplicate ports issue has already been fixed in the beta build of the Arduino IDE. It is caused by disconnecting your board while the Serial Monitor is open. If you're not intentionally disconnecting your board, maybe you have a bad USB cable or jack, which is causing intermittent disconnections?

Once you exit the Arduino IDE and restart it, the duplicate ports should be gone.

There is also a separate bug that causes uploads to native USB boards like the Leonardo and MKR boards to fail after disconnecting while the Serial Monitor is open:

> <https://github.com/arduino/Arduino/issues/8851>
>
> Arduino IDE Hourly Build 2019/04/18 12:33 / Arduino IDE 1.9.0-beta build 105, Wi…ndows 10 64 bit
> 
> 1. Plug the USB cable of a native USB (Leonardo, MKR, Due (Native USB Port)) into your computer.
> 1. Tools \> Serial Monitor
> 1. Unplug the USB cable.
> 1. Close Serial Monitor (to avoid https://github.com/arduino/Arduino/issues/8518 when using Arduino IDE 1.9.0-beta).
> 1. Plug the USB cable of the board into your computer. It doesn't matter whether this is done before or after closing Serial Monitor.
> 1. Sketch \> Upload
> 
> The upload process completes successfully, but the Arduino IDE doesn't recognize this and after a delay the upload is shown to have failed with the error:
> \`\`\`
> Couldn't find a Board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.
> \`\`\`
> You must now exit the Arduino IDE and start it again before you can upload without the spurious failure.
> 
> When using Arduino IDE 1.8.9 or the Hourly Build, disconnecting the board while Serial Monitor is open and then reconnecting causes multiple duplicate ports to be shown in the \*\*Tools \> Port\*\* menu. This does not occur with Arduino IDE 1.9.0-beta, but the spurious upload failure still does occur.
> 
> !\[Clipboard02\](https://user-images.githubusercontent.com/8572152/57188314-5e304800-6eb1-11e9-8c5d-50f3c1ed06f1.png)
> 
> The duplicate ports and spurious upload failure issue does not occur with Arduino IDE 1.8.8.
> 
> Originally reported at:
> \- https://forum.arduino.cc/index.php?topic=613070
> \- https://forum.arduino.cc/index.php?topic=443558.msg4160634#msg4160634

However, the Mega, Uno, and Nano are not affected by that bug. I have never found the multiple ports issue to cause uploads to Mega, Uno, or Nano to fail.

Please do this:

- (In the Arduino IDE) File \> Preferences
- Uncheck the checkbox next to "Show verbose output during: compilation"
- Check the checkbox next to "Show verbose output during: upload
- Click "OK"
- Sketch \> Upload
- After the upload fails, you'll see a button on the right side of the orange bar "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
- In a forum reply here, click on the reply field.
- Click the **\</\>** button on the forum toolbar. This will add the forum's code tags markup to your reply.
- Press "Ctrl + V". This will [paste](https://lifehacker.com/how-to-copy-cut-and-paste-for-beginners-5801525) the upload output between the code tags.
- Move the cursor outside of the code tags before you add any additional text to your reply.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 6:08pm UTC](https://forum.arduino.cc/t/sketch-upload-problem-and-port-duplication/591067/3 "2021-05-06T18:08:51Z")

</div>


