Logging: no attachment when sharing log to K-9 mail



  • Problem Description

    While I can activate logging (main screen -> menu -> settings), and I do get a notification, that notification does not say where the logs are saved. The only option is to “share” them. However, that does not work either: When sharing via email, no file is attached.

    I noticed:

    • The Android/data directory does not have an at.bitfire… subdirectory or anything else with davdroid or davx5 in its name.
    • DAVdroid does not require Android permission to write files.

    Did I miss something, or is this a bug?

    Device info

    DAVx5 version 2.2-gplay (261)
    LineageOS 15.1-20181231
    BQ Aquaris X (bardock)


  • developer

    @Triton said in Logging fails:

    Problem Description

    While I can activate logging (main screen -> menu -> settings), and I do get a notification, that notification does not say where the logs are saved.

    Because they’re not accessible from external apps anymore, so that

    1. logging doesn’t depend on external storage anymore,
    2. better security can be provided (logs which contain private data are only exported using the FileProvider and can’t be read by any app directly from the external storage like before).

    The only option is to “share” them. However, that does not work either: When sharing via email, no file is attached.

    This is working in the emulator and on our testing devices.

    • Which device? Which Android version
    • Which email app did you use?
    • Did you try to share with another app, for instance Share via HTTP?
    • Can you share the debug info?
    • Does your email app show the attachment and then doesn’t send it or doesn’t it show up at all?

    I noticed:

    • The Android/data directory does not have an at.bitfire… subdirectory or anything else with davdroid or davx5 in its name.

    Exactly. 🙂 Internally, it’s now in /data/data/at.bitfire.davdroid or whatever Context.getFilesDir() returns on your device, but that shouldn’t matter.

    • DAVdroid does not require Android permission to write files.

    Every app has permission to write its own files. No additional permissions (like writing to an external storage) are required.



  • If “log to external storage” does not exist anymore, it would be helpful to adjust the FAQ “[READ BEFORE POSTING] What’s required to diagnose a problem”.

    Android version is given above, I now also added hardware info.

    Trying to share via email I used K-9 Mail (and failed).

    I prefer no to use any http app to share the log before I know what it will do and where it will post. (Perhaps some information on that process would also be helpful in the FAQ.)

    Debug info redacted and uploaded. DAVx5 DEBUG INFO.txt


  • developer

    @Triton said in Logging fails:

    If “log to external storage” does not exist anymore, it would be helpful to adjust the FAQ “[READ BEFORE POSTING] What’s required to diagnose a problem”.

    Of course. I’m sorry that it’s out of date for one or two days. I can’t do anything at once and will of course accept a new description if you can provide one. Has been updated.

    Android version is given above, I now also added hardware info.

    Thanks. Which Android version is LinageOS 15.1? Is it 8.1? I don’t know LinageOS by heart, I only have it on some rarely used testing devices. But I’ll try there. - Ah yes, 8.1 (see debug info).

    Trying to share via email I used K-9 Mail (and failed).

    Did you try another app to share it to, like the default email app, a trusted messenger, Copy to clipboard, send to your Nextcloud, anything else? This would help to see whether the problem is related to K-9 mail or not.

    Did you try multiple times or only once?

    I prefer no to use any http app to share the log before I know what it will do and where it will post. (Perhaps some information on that process would also be helpful in the FAQ.)

    Share via HTTP opens an HTTP server in your LAN and you can access it from your browser in that LAN. By the way, Share via HTTP is open-source. Of course, you can use any other app, it’s just an example. Personally, I use Share via HTTP because it’s useful for me.

    Debug info redacted and uploaded. DAVx5 DEBUG INFO.txt

    Ok, so sharing debug info works? Did you share the debug info to K-9 mail, too? Debug info and log sharing use almost the same mechanism (but of course the problem can be in detail).


  • developer

    Did you maybe stop logging before the email was actually sent? In this case, the attachment woulnd’t be accessible by the mail app anymore…



  • @rfc2822

    Did you maybe stop logging before the email was actually sent?

    No, logging was on all the time.

    Did you try multiple times or only once?

    Multiple times.

    Debug info redacted and uploaded.

    Ok, so sharing debug info works? Did you share the debug info to K-9 mail, too? Debug info and log sharing use almost the same mechanism (but of course the problem can be in detail).

    Well, no, I did not even try that. I had copied the text, saved it to a file, and copied that via USB.
    But since you asked, I now tried sharing the debug info via K-9 Mail, and this works. Since that worked, I tried sharing the log again, and now that works, too!

    So perhaps the bug is: Sharing of logs only works after sharing of debug info done once? It may actually not be K-9-Mail related, as the changed title now suggests.

    Also, for privacy reasons I would really appreciate some method of looking at the logs locally on the device before sending them anywhere. Saving them to some folder would be sufficient. From there on eyerything would be under the user’s control.


  • developer

    @Triton said in Logging: no attachment when sharing log to K-9 mail:

    Ok, so sharing debug info works? Did you share the debug info to K-9 mail, too? Debug info and log sharing use almost the same mechanism (but of course the problem can be in detail).

    Well, no, I did not even try that. I had copied the text, saved it to a file, and copied that via USB.

    If you have Amaze installed (isn’t it installed by default in most Lineage builds?), you can share to “Save as…” to save the file:

    Screenshot_1546616451.png

    So perhaps the bug is: Sharing of logs only works after sharing of debug info done once? It may actually not be K-9-Mail related, as the changed title now suggests.

    If you find a way to reproduce this, please let me know. I couldn’t reproduce it even when clearing the app data before and then sending it to K-9 mail.

    I have changed the title to what happened according to your description, because “Logging fails” doesn’t contain specific information for people who might have the same problem.

    Also, for privacy reasons I would really appreciate some method of looking at the logs locally on the device before sending them anywhere.

    This seems to be a misunderstanding: “Sharing” the log doesn’t mean to “send” it to a server or something like that. It just shares the data with another app in a policed way. For instance, you can “share” with Amaze’s “Save as…”, or “share” with “Save to clipboard”, or “share” with Share via HTTP to make the file temporarily available on a local (!) Web server.

    When DAVx⁵ would save the logs to a folder, every app with external storage permission could access the logs, so it would be the same as you would permanently “share” the logs to all apps with external storage permission.

    Saving them to some folder would be sufficient. From there on eyerything would be under the user’s control.

    If you save the logs to a folder on an external storage, every app with permissions to access external storage can read the logs and all its private data. This is why we have pointed out that users should delete logs as soon as they didn’t need it anymore.

    Logs on external storage (DAVx⁵ until 2.2): All apps with external storage permissions can access the logs. Users don’t have control which apps are accessing the logs. Malware might watch the external storage for changes and immediately send all files to a malicious server. If the logs are saved to your SD card, people can physically remove the SD card from your device and read the logs (except you have set up encryption for the SD card).

    Also, it’s very cumbersome because you need a file manager app, fiddle around with file locations, permissions etc. It’s just not how Android apps should feel like.

    Logs in internal directory, sharing over FileProvider as recommended in Android guidelines (DAVx⁵ 2.2+): Logs can’t be read by any other apps (without root privileges). Only when the user “shares” the log to another app, this specific app can temporarily access the logs.



  • @rfc2822 said in Logging: no attachment when sharing log to K-9 mail:

    This seems to be a misunderstanding: “Sharing” the log doesn’t mean to “send” it to a server or something like that.

    Well, it wasn’t a misunderstanding about “sharing”. LineageOS does not offer to “Copy to clipboard” when sharing. “Amaze” is also not distributed with LineageOS. Therefore there is absolutely no sharing method that will keep the file to be shared local to the device. This is my privacy concern: One has to send the DAVx⁵ log somwhere in order to read it. (“Copy to clipboard” of course is in no way safer than saving to a folder, because any app may watch the clipboard.) Personally I think that installing “Amaze” or “Share via HTTP” is a higher risk to the phone than temporarily storing a log of contact and calendar data transactions.

    Although the reason for my inability to log (as discussed above) remains unclear, since I now can log again, I leave it up to you to close this issue. Many thanks for your assistance!


  • developer

    @Triton said in Logging: no attachment when sharing log to K-9 mail:

    Personally I think that installing “Amaze” or “Share via HTTP” is a higher risk to the phone than temporarily storing a log of contact and calendar data transactions.

    What are the security risks in installing “Amaze” or “Share via HTTP” in your opinion? (Of course, there are many other options you can use with “Share”, for instance upload to your own WebDAV server, send to your own mail server etc.)

    As said above, leaving logs in external storage allows all installed apps with external storage permission to immediately access those logs. I’ll consider the way the Android docs: Sharing files recommends to be better, more secure and easier to use. That’s why we have implemented it and I hope that it will be useful for you and other users.

    By the way, I have renamed “Share log” to “Send log” to make it more clear that you don’t have to share anything.

    If logging doesn’t work again, feel free to post here again!



  • Hey,
    I just want to report that I have the same problem with the verbose log on Lineage 14.1 (Android 7.1.2). I cannot send the log with any of the provided options and also using Amaze just produces an empty file.
    For now it doesn’t bother me anymore, because I could solve my original problem similar to this https://forums.bitfire.at/topic/415/calendar-sync-does-not-work-with-posteo-de/7 without the verbose log
    If you, @rfc2822, are interested let me know if i can provide you any data or logs.


  • developer

    @lopa Can you reproduce this? In my tests, it sometimes didn’t work at the first time, but I could never reproduce it.



  • I tried several times and itnever works.


  • developer

    @lopa Ok then it would just be interesting how I could reproduce it… do you have any ideas? On my Android 7.1.2 it works …



  • @rfc2822 Sorry, I have no idea.


Log in to reply
 

Similar topics

  • 2
  • 2
  • 2