Chaincase-iOS-Beta icon indicating copy to clipboard operation
Chaincase-iOS-Beta copied to clipboard

EnvironmentHelper tries unauthorized access to .walletwasabi/client every run on iOS device

Open DanGould opened this issue 4 years ago • 1 comments

This causes problems when people read back the logs to us even though the error is benign.

2021-02-12 11:33:55.885 Chaincase.iOS[1591:379220] 2021-02-12 11:33:55 INFO EnvironmentHelpers (85) Creating data directory at `/private/var/mobile/Containers/Data/Application/F09EB2C6-44FD-40EF-967F-2B04580463C7/.walletwasabi/client`. 2021-02-12 11:33:55 WARNING IndexStore (271) Backwards compatibility could not be ensured. Exception: System.UnauthorizedAccessException: Access to the path '/private/var/mobile/Containers/Data/Application/F09EB2C6-44FD-40EF-967F-2B04580463C7/.walletwasabi/client' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace --- at System.IO.FileSystem.CreateDirectory (System.String fullPath) [0x00192] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/FileSystem.Unix.cs:319 at System.IO.Directory.CreateDirectory (System.String path) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:40 at WalletWasabi.Helpers.EnvironmentHelpers.GetDataDir (System.String appName) [0x00121] in /Users/dan/f/chaincase/app/WalletWasabi/WalletWasabi.Standard/Helpers/EnvironmentHelpers.cs:86 at WalletWasabi.Stores.IndexStore.EnsureBackwardsCompatibilityAsync () [0x0003e] in /Users/dan/f/chaincase/app/WalletWasabi/WalletWasabi.Standard/Stores/IndexStore.cs:227 . 2021-02-12 11:33:55.889 Chaincase.iOS[1591:379220] 2021-02-12 11:33:55 WARNING IndexStore (271) Backwards compatibility could not be ensured. Exception: System.UnauthorizedAccessException: Access to the path '/private/var/mobile/Containers/Data/Application/F09EB2C6-44FD-40EF-967F-2B04580463C7/.walletwasabi/client' is denied. ---> System.IO.IOException: Operation not permitted --- End of inner exception stack trace --- at System.IO.FileSystem.CreateDirectory (System.String fullPath) [0x00192] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/FileSystem.Unix.cs:319 at System.IO.Directory.CreateDirectory (System.String path) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.IO.FileSystem/src/System/IO/Directory.cs:40 at WalletWasabi.Helpers.EnvironmentHelpers.GetDataDir (System.String appName) [0x00121] in /Users/dan/f/chaincase/app/WalletWasabi/WalletWasabi.Standard/Helpers/EnvironmentHelpers.cs:86 at WalletWasabi.Stores.IndexStore.EnsureBackwardsCompatibilityAsync () [0x0003e] in /Users/dan/f/chaincase/app/WalletWasabi/WalletWasabi.Standard/Stores/IndexStore.cs:227 .

DanGould avatar Feb 12 '21 16:02 DanGould

Seems this could be resolved by injecting an up-to-date EnvironmentHelper that accounts for iOS, but unfortunately that's part of Wasabi as is. These two EnsureBackwardsCompatibility functions throw even though we never supported 1.1.5 through 1.1.7 so they're really safe to ignore in Chaincase.

https://github.com/chaincase-app/WalletWasabi.Standard/blob/dc8d62328c12df4f6e82bc14eb38e6b5e78aa724/WalletWasabi.Standard/Stores/IndexStore.cs#L72

https://github.com/chaincase-app/WalletWasabi.Standard/blob/dc8d62328c12df4f6e82bc14eb38e6b5e78aa724/WalletWasabi.Standard/Blockchain/Transactions/AllTransactionStore.cs#L51

This can probably continue to be ignored it's more a nuisance than an actual problem.

DanGould avatar Feb 12 '21 17:02 DanGould