Can't upload to Leonardo board

I have a Borderless Electronics Leonardo, which is a clone but until today worked fine for me.

I have an old project that I tried to rebuild and upload, but failed. I went back to upload the "blink LED 13" sketch as a test, and not even that is being uploaded, failures are changing and piling.

Started with online editor, switched to local one (1.8.11), Ubuntu OS, running IDE as root (was unsure just the dialout group was going to be enough to access the ports). Board is correctly set to "Arduino Leonardo". Enabled verbose upload logging for extra info.

Initially it simply wouldn't ever finish the upload, and with the log it seemed to be because of signature mismatch:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/user/Downloads/arduino-1.8.11-linux64/arduino-1.8.11/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM1
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 3.65s

avrdude: Device signature = 0x0d3f0d
avrdude: Expected signature for ATmega32U4 is 1E 95 87
         Double check chip, or use -F to override this check.

Now when I plug the board its TTY port stays in the menu for as long as the leds blink, once it just stays solid ON and nothing else, it vanishes. I'm trying to start upload and then plug the board, which is then recognized but many times it just fails to proceed. When it seems to go further, it still fails (log in the next message, because message is beyond size limit).

How can I troubleshoot this?

Thanks!

My second log:

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/user/Downloads/arduino-1.8.11-linux64/arduino-1.8.11/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM1
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 
.?; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "/tmp/arduino_build_867738/sketch_feb07b.ino.hex"
avrdude: writing flash (3956 bytes):

Writing | ################avrdude: error: programmer did not respond to command: write block
# ***failed;  
 ***failed;  
 ***failed;
(repeats a lot)  
 ***failed;  
 ***failed;  
 ***failed;  
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
 *** page 127 (addresses 0x0000 - 0x007f) failed to write

 ***failed;  
 ***failed;  
 ***failed;  
(a lot more)
 ***failed;  
 ***failed;  
 ***failed;  
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
 *** page 127 (addresses 0x0080 - 0x00ff) failed to write

 ***failed;  
 ***failed;  
 ***failed; 
(and so it goes like that many more times)
 ***failed;  
 ***failed;  
 ***failed;  
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
 *** page 115 (addresses 0x0ef4 - 0x0f73) failed to write

# | 100% 8.88s

avrdude: 3956 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_867738/sketch_feb07b.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_867738/sketch_feb07b.ino.hex:
avrdude: input file /tmp/arduino_build_867738/sketch_feb07b.ino.hex contains 3956 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: butterfly_recv(): programmer is not responding
########################avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr

########################## | 100% 10.04s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x005e
         0xf6 != 0x76
avrdude: verification error; content mismatch

avrdude done.  Thank you.

Find the folder you downloaded Arduino to, right click to open a terminal from there, then run "./arduino-linux-setup.sh"

This happens to me on Debian, and seems to be a debian based problem with virtual serial ports. Other Arduino boards should work, but running that setup file has fixed 32u4 for me