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.

CWA log filename contains characters reserved under Windows

See original GitHub issue

Avoid duplicates

  • Bug is not mentioned in the FAQ
  • Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • Bug is not already reported in another issue

Technical details

  • Device name: Pixel 3a emulator
  • Android version: 11
  • App version: 2.2.1 (and 2.3.0-RC0)

Describe the bug

Attempting to unzip an error report from CWA using the Microsoft Windows built-in Extract command results in Error 0x80070057: The parameter is incorrect.

Steps to reproduce the issue

  1. On the CWA Start Screen tap the three-dot symbol
  2. Tap “App Information”
  3. Tap “Error Reports”
  4. Tap “SHARE AND CONTINUE”
  5. Tap (Google) Drive - Save to Drive
  6. Document title will be similar to “CWA Log 2021-05-12 14:07:40.331.zip”
  7. Tap “Save”
  8. On Microsoft Windows 10 system open https://drive.google.com/drive/my-drive
  9. Right click and select Download
  10. Downloaded filename is changed, for instance to “CWA Log 2021-05-12 14_07_40.331.zip”
  11. Right-click downloaded file and select “Extract All…”
  12. Click Extract
  13. Note error message “Error 0x80070057: The parameter is incorrect.”

image

The error is caused by the zipped filename containing colons “:” which is a reserved character for Microsoft Windows filenames. See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions.

Expected behavior

It should be possible to view the contents of a CWA Error Report using the built-in Microsoft Windows zip Extract command. Filenaming should be consistent with Microsoft Windows rules and not cause errors.

Possible Fix

Replace “:” in the filename by “_”.

The line of code seems to be https://github.com/corona-warn-app/cwa-app-android/blob/595ab630dfad5ac1e29021c084c400054193a498/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/bugreporting/debuglog/internal/LogSnapshotter.kt#L36

Workaround

Use 7-zip to unzip the file.

Despite the error from the Microsoft Windows built-in tool, it does in fact extract the log file contents.


Internal Tracking-ID: EXPOSUREAPP-7266

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
MikeMcC399commented, May 20, 2021

Not an issue under iOS, see https://github.com/corona-warn-app/cwa-app-android/issues/3183#issuecomment-841801940 from @Ein-Tim who writes that iOS uses the filename cwa-log.

1reaction
MikeMcC399commented, May 20, 2021

PR #3235 is now working correctly and is ready for review.

Thanks again to @PhilippNowak96!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Reserved File Names and Characters
The Windows operating system has a list of reserved words/names that cannot be used to name files, and also there are also certain...
Read more >
Naming Files, Paths, and Namespaces - Win32 apps
This is true even if a long file name contains extended characters, regardless of the code page that is active during a disk...
Read more >
Why are special characters not allowed in file names? - Quora
It depends on the operating system. As others have said, on Microsoft systems many characters are not allowed. But on Unix variants, including...
Read more >
Characters to Avoid in Filenames and Directories
Therefore, it is essential to play it safe and avoid common illegal filename and directory characters. Naming conventions are important in web folders...
Read more >
What characters are forbidden in Windows and Linux directory ...
Worse, seemingly-allowed names like PRN and CON , and many others, are reserved and not allowed. Windows also has several length restrictions; a...
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