Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with ArgumentNullException in System.Windows.Forms.CurrencyManager when loading Preferences #15795

Closed
Fydon opened this issue Apr 3, 2024 · 8 comments · Fixed by #15819 or #16115
Assignees
Milestone

Comments

@Fydon
Copy link
Contributor

Fydon commented Apr 3, 2024

Describe the bug
When attempting to adjust preferences by going to the Preferences menu item, the app crashes. Therefore I can't access the latest snapshot builds. I've tried reverting to 8.8.0 and 8.7.3 and repairing the install of 8.8.1.41263, but it still crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Preferences

Expected behavior
Preferences load

Screenshots
If applicable, add screenshots to help explain your problem.
Cyberduck

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: 23H2 build 22631.3296

Log Files
The following is the crash report 638477617558948223.txt

@Fydon
Copy link
Contributor Author

Fydon commented Apr 9, 2024

I've tried opening Preferences with 8.8.2 and it also crashes. I'll try repairing the install with 8.8.2 once the download links on the website are working. Crash report: 638482318813424446.txt

@dkocher dkocher changed the title Crash when loading Preferences Crash with ArgumentNullException in System.Windows.Forms.CurrencyManager when loading Preferences Apr 9, 2024
@dkocher dkocher added this to the 8.8.3 milestone Apr 9, 2024
@AliveDevil
Copy link
Contributor

AliveDevil commented Apr 9, 2024

Thanks for both crash reports, not quite sure why it's crashing on your end.

If it continuous to crash even when downgrading to a version that previously worked, can you check whether resetting Cyberduck makes a difference (Bookmarks, Profiles, History will be kept).
For this rename the file "Cyberduck.user.config" in %AppData%\Cyberduck to Cyberduck.user.config.bak, if you want to be on the safe side you can move all folders in %AppData%\iterate_GmbH\ that start with Cyberduck.

Your configured locale is en-GB, and you don't have other culture/region changes applied?

@AliveDevil
Copy link
Contributor

Fails in
https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/ListControl.cs,427
So some ComboBox-selected value setter in

private void Init()
{
#region General
View.SaveWorkspace = PreferencesFactory.get().getBoolean("browser.serialize");
View.NewBrowserOnStartup = PreferencesFactory.get().getBoolean("browser.openUntitled");
PopulateBookmarks();
BookmarkCollection.defaultCollection().addListener(this);
View.ViewClosedEvent += delegate { BookmarkCollection.defaultCollection().removeListener(this); };
SelectDefaultBookmark(PreferencesFactory.get().getProperty("browser.open.bookmark.default"));
View.ConfirmDisconnect = PreferencesFactory.get().getBoolean("browser.disconnect.confirm");
View.UseKeychain = PreferencesFactory.get().getBoolean("connection.login.keychain");
PopulateDefaultProtocols();
View.DefaultProtocol =
ProtocolFactory.get().forName(PreferencesFactory.get().getProperty("connection.protocol.default"));
View.AlternatingRowBackground = PreferencesFactory.get().getBoolean("browser.alternatingRows");
View.VerticalLines = PreferencesFactory.get().getBoolean("browser.verticalLines");
View.HorizontalLines = PreferencesFactory.get().getBoolean("browser.horizontalLines");
PopulateEncodings();
View.DefaultEncoding = PreferencesFactory.get().getProperty("browser.charset.encoding");
#endregion
#region Browser
View.InfoWindowShowsCurrentSelection = PreferencesFactory.get().getBoolean("browser.info.inspector");
View.ShowHiddenFiles = PreferencesFactory.get().getBoolean("browser.showHidden");
View.DoubleClickEditor = PreferencesFactory.get().getBoolean("browser.doubleclick.edit");
View.ReturnKeyRenames = PreferencesFactory.get().getBoolean("browser.enterkey.rename");
PopulateBookmarkSize();
View.BookmarkSize = PreferencesFactory.get().getInteger("bookmark.icon.size");
#endregion
#region Transfers - General
PopulateTransferModes();
View.TransferMode = Host.TransferType.valueOf(PreferencesFactory.get().getProperty("queue.transfer.type"));
View.TransfersToFront = PreferencesFactory.get().getBoolean("queue.window.open.transfer.start");
View.TransfersToBack = PreferencesFactory.get().getBoolean("queue.window.open.transfer.stop");
View.RemoveFromTransfers = PreferencesFactory.get().getBoolean("queue.removeItemWhenComplete");
View.SegmentedDownloads = PreferencesFactory.get().getBoolean("queue.download.segments");
View.OpenAfterDownload = PreferencesFactory.get().getBoolean("queue.download.complete.open");
View.DownloadFolder = PreferencesFactory.get().getProperty("queue.download.folder");
PopulateDuplicateActions();
View.DuplicateDownloadAction = GetDuplicateAction("queue.download.action");
View.DuplicateUploadAction = GetDuplicateAction("queue.upload.action");
View.DuplicateDownloadOverwrite =
PreferencesFactory.get()
.getProperty("queue.download.reload.action")
.Equals(TransferAction.overwrite.toString())
? true
: false;
View.DuplicateUploadOverwrite =
PreferencesFactory.get()
.getProperty("queue.upload.reload.action")
.Equals(TransferAction.overwrite.toString())
? true
: false;
View.UploadWithTemporaryFilename = PreferencesFactory.get().getBoolean("queue.upload.file.temporary");
#endregion
#region Editor
PopulateAndSelectEditor();
View.AlwaysUseDefaultEditor = PreferencesFactory.get().getBoolean("editor.alwaysUseDefault");
#endregion
#region Transfers - Permissions
PopulateChmodTypes();
View.ChmodDownload = PreferencesFactory.get().getBoolean("queue.download.permissions.change");
View.ChmodDownloadEnabled = View.ChmodDownload;
View.ChmodDownloadUseDefault = PreferencesFactory.get().getBoolean("queue.download.permissions.default");
View.ChmodDownloadDefaultEnabled = View.ChmodDownloadUseDefault;
View.ChmodDownloadType = ForFiles;
View_ChmodDownloadTypeChangedEvent();
View.ChmodUpload = PreferencesFactory.get().getBoolean("queue.upload.permissions.change");
View.ChmodUploadEnabled = View.ChmodUpload;
View.ChmodUploadUseDefault = PreferencesFactory.get().getBoolean("queue.upload.permissions.default");
View.ChmodUploadDefaultEnabled = PreferencesFactory.get().getBoolean("queue.upload.permissions.change") &&
PreferencesFactory.get().getBoolean("queue.upload.permissions.default");
View.ChmodUploadType = ForFiles;
View_ChmodUploadTypeChangedEvent();
#endregion
#region Transfers - Timestamps
View.PreserveModificationDownload = PreferencesFactory.get().getBoolean("queue.download.timestamp.change");
View.PreserveModificationUpload = PreferencesFactory.get().getBoolean("queue.upload.timestamp.change");
#endregion
#region Transfers - Checksum
View.VerifyChecksumDownload = PreferencesFactory.get().getBoolean("queue.download.checksum.calculate");
View.VerifyChecksumUpload = PreferencesFactory.get().getBoolean("queue.upload.checksum.calculate");
#endregion
#region Transfers - Advanced
View.DownloadSkip = PreferencesFactory.get().getBoolean("queue.download.skip.enable");
View.DownloadSkipRegex = PreferencesFactory.get().getProperty("queue.download.skip.regex");
View.DownloadSkipRegexEnabled = View.DownloadSkip;
View.UploadSkip = PreferencesFactory.get().getBoolean("queue.upload.skip.enable");
View.UploadSkipRegex = PreferencesFactory.get().getProperty("queue.upload.skip.regex");
View.UploadSkipRegexEnabled = View.UploadSkip;
PopulateDefaultDownloadThrottleList();
PopulateDefaultUploadThrottleList();
View.DefaultDownloadThrottle = PreferencesFactory.get().getFloat("queue.download.bandwidth.bytes");
View.DefaultUploadThrottle = PreferencesFactory.get().getFloat("queue.upload.bandwidth.bytes");
View.Retries = PreferencesFactory.get().getInteger("connection.retry");
View.RetryDelay = PreferencesFactory.get().getInteger("connection.retry.delay");
View.ConnectionTimeout = connectionTimeoutPreferences.getTimeout();
View.UseSystemProxy = PreferencesFactory.get().getBoolean("connection.proxy.enable");
View.DebugLog = Level.DEBUG.equals(LoggerContext.getContext(false).getConfiguration().getRootLogger().getLevel()) ? true : false;
#endregion
#region S3
PopulateDefaultS3BucketLocations();
View.DefaultS3BucketLocation = PreferencesFactory.get().getProperty("s3.location");
PopulateDefaultS3StorageClasses();
View.DefaultS3StorageClass = PreferencesFactory.get().getProperty("s3.storage.class");
PopulateDefaultEncryption();
String algorithm = PreferencesFactory.get().getProperty("s3.encryption.algorithm");
View.DefaultEncryption = Utils.IsNotBlank(algorithm) ? algorithm : Encryption.Algorithm.NONE.ToString();
PopulateDefaultS3ACL();
View.DefaultS3ACL = PreferencesFactory.get().getProperty("s3.acl.default");
#endregion
#region Google Storage
PopulateDefaultGoogleBucketLocations();
View.DefaultGoogleBucketLocation = PreferencesFactory.get().getProperty("googlestorage.location");
PopulateDefaultGoogleStorageClasses();
View.DefaultGoogleStorageClass = PreferencesFactory.get().getProperty("googlestorage.storage.class");
PopulateDefaultGoogleACL();
View.DefaultGoogleACL = PreferencesFactory.get().getProperty("googlestorage.acl.default");
#endregion
#region Update
View.UpdateEnabled = PeriodicUpdateCheckerFactory.get().hasUpdatePrivileges();
View.AutomaticUpdateCheck = PreferencesFactory.get().getBoolean("update.check");
long lastCheck = PreferencesFactory.get().getLong("update.check.timestamp");
View.LastUpdateCheck = 0 == lastCheck
? String.Empty
: UserDateFormatterFactory.get().getLongFormat(lastCheck);
PopulateFeeds();
View.UpdateFeed = PreferencesFactory.get().getProperty("update.feed");
#endregion
#region Language
PopulateLanguages();
string userLanguage = PreferencesFactory.get().getProperty("application.language");
if (PreferencesFactory.get().getBoolean("application.language.custom"))
{
View.CurrentLocale = userLanguage;
}
else
{
View.CurrentLocale = "default";
}
#endregion
#region Cryptomator
View.AutoDetectVault = PreferencesFactory.get().getBoolean("cryptomator.vault.autodetect");
View.VaultUseKeychain = PreferencesFactory.get().getBoolean("cryptomator.vault.keychain");
#endregion
}
sets a Null-value.

@AliveDevil
Copy link
Contributor

Tested this, and found this behavior:

  • In Profiles-tab enable a profile
  • Restart Cyberduck
  • In Connection-tab set profile to downloaded profile
  • Disable/Remove profile from Profiles-tab (or delete file)
  • Restart Cyberduck
  • Open Preferences
  • Observe crash

If you don't want to reset all settings, you can delete the line starting with <setting name="connection.protocol.default".

@AliveDevil
Copy link
Contributor

@dkocher
Whats the plan here?
On null return of ProfilesFactory try again with Preferences.getDefault("connection.protocol.default") or add a "Unknown"-entry for fallback (unselectable)?

@Fydon
Copy link
Contributor Author

Fydon commented Apr 9, 2024

Thank you so much. Commenting out <setting name="connection.protocol.default" solved the issue. It was <setting name="connection.protocol.default" value="s3-s3-token" />

@dkocher
Copy link
Contributor

dkocher commented Apr 9, 2024

@dkocher Whats the plan here? On null return of ProfilesFactory try again with Preferences.getDefault("connection.protocol.default") or add a "Unknown"-entry for fallback (unselectable)?

Yes, we should have a generic fallback to getDefault("connection.protocol.default").

@Fydon
Copy link
Contributor Author

Fydon commented Apr 11, 2024

Was this related to the profile S3 (Credentials from AWS Security Token Service) being removed?

I see it is no longer available in the profile list and the link on the website doesn't work. The secition should probably be replaced with https://profiles.cyberduck.io/S3%20(Credentials%20from%20AWS%20Command%20Line%20Interface).cyberduckprofile, which can be used to obtain temporary credentials from the AWS Security Token Service (STS).

When selecting one of the profiles to download, I instead see the contents of the file rather than it downloading. Mozilla have some suggestions, although most people probably using the interface inside Cyberduck to add profiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants