question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error transferring command; errno 0 null

See original GitHub issue

Problem

Cannot write more than 100-ish files to the drive in a row, and drive loses connection. This is only happening on new drives that we are using, and cannot be reproduced on all drives. I have tried reformatting the drive and it does not help.

Expected behavior

To be able to continuously write files to the drive

Actual behavior

receive error when attempting to write the drive, and drive loses connection

Stacktrace of Excpetion

D/ClusterChain: Init a cluster chain, reading from FAT D/ClusterChain: Finished init of a cluster chain D/ClusterChain: grow chain D/FsInfoStructure: writing to device I/FAT: allocating clusters finished E/ScsiBlockDevice: Error transferring command; errno 0 null D/ScsiBlockDevice: Reset bulk-only mass storage W/ScsiBlockDevice: sending bulk only mass storage request D/ScsiBlockDevice: Trying to clear halt on both endpoints W/AndroidUsbCommunication: Clearing halt on endpoint UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0] (direction 128) 2020-05-08 18:01:46.013 16002-16816/ W/AndroidUsbCommunication: Clearing halt on endpoint UsbEndpoint[mAddress=1,mAttributes=2,mMaxPacketSize=512,mInterval=0] (direction 0) E/ScsiBlockDevice: Error transferring command; errno 0 null D/ScsiBlockDevice: Trying to reset the device D/AndroidUsbCommunication: Performing native reset W/AndroidUsbCommunication: ioctl failed! errno 0 null W/AndroidUsbCommunication: USB device will likely require new discovery and permissions

I also see this when I run first aid on the drive following the issue:

/Backups/Nexus 6P/Camera/10H.jpg has too many clusters allocated (logical=0, physical=2195456)

Code where problem occurs

val buf = ByteArray(fileToWrite.chunkSize)
var count: Int
while (inputStream.read(buf).also { count = it } > 0) {
     outputStream.write(buf, 0, count)
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
depaucommented, Jun 4, 2020

Can the transfer be trapped at the failed write then made to wait 10 seconds before searching for the device and attempting to repeat last write and continue? If so, we could eliminate heat as a possible factor, even if we expect it to have to do that a few times to complete a burn process.

This has been tried, at least by me since many times I stepped around in the debugger while this issue was going on. No, waiting won’t do any good.

Can you please attach here the logcat including the part before the issue occurs? I’m expecting to see some attempted recovery steps.

Also if your device is rooted and you can provide the kernel log, that would help too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error code reference tables - IBM
This list summarizes all errors and error codes that could be thrown by Aspera SDK components including Web Services andfaspmanager. These ...
Read more >
Beyond errno Error Handling in C - SEI Digital Library
The value of errno is zero at program startup, but is never set to zero by any library function.
Read more >
php - curl error 18 - transfer closed with outstanding read data ...
My header did not appear in the response and it appears to have caused the CURL error. I explicitly set the header above...
Read more >
web.mit.edu/freebsd/head/contrib/tnftp/src/ftp.c
In the case of error, errno contains the appropriate error code. ... NULL); } errno = 0; inc = outc = 0; /*...
Read more >
Diff - 0940fe1^! - platform/bootable/recovery - Git at Google
... val = strtol(token, NULL, 0); + val = strtol(pieces[0].c_str(), nullptr, 0); - if (errno != 0 || val < 2 || val...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found