Profile locking
Closed this issue · 2 comments
Checklist
- I understand that Streamlink Twitch GUI is just a launcher for Streamlink
- I have read the contribution guidelines
- I have checked the list of open and recently closed issues
- I have checked the commit log of the master branch
Streamlink Twitch GUI version
2.5.2
Streamlink version
6.11
Operating system, environment and configuration details
Arch Linux
Description
First and foremost, this is probably an issue impossible to reproduce as there are no logs around, the last release isn't new and this is a first happening in years of use. Probably just a nw.js problem rather than a Streamlink-Twitch-GUI one also for that matter, so I don't expect exactly a fix, but this might serve as fixing instructions rather than wiping a profile and having to resetup everything.
Earlier today, I closed Streamlink Twitch GUI (sometimes doing it, I sometimes have too much fan activity on a laptop even with not much open, wondering if something is using hardware acceleration, therefore causing more GPU heat and more need for cooling, and sometimes wondering if Twitch GUI could be a culprit, but that's yet another story).
It looks like closing it (with just the cross, ctrl + q
unfortunately doesn't work) didn't went well: when I tried to restart it later, it didn't start at all.
A look at the terminal/logs, got me finding this:
Oct 09 22:51:10 x1-carbon-$USER streamlink-twitch-gui.desktop[1929249]: [1929249:1929249:1009/225110.307748:ERROR:chrome_main_delegate.cc(577)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new w>
Oct 09 22:51:10 x1-carbon-$USER streamlink-twitch-gui.desktop[1929249]: [1929249:1929249:1009/225110.307415:ERROR:process_singleton_posix.cc(335)] Failed to create /home/$USER/.config/streamlink-twitch-gui/SingletonLock: File exists (17)
Okay, lock file wasn't released for some reason, so I got rid of it.
After that, it acted as a first start and seemed to still have some issues accessing the profile:
I could find this in logs:
[1932196:1932209:1009/231501.879032:ERROR:model_type_store_service_impl.cc(38)] Failed to initialize ModelTypeStore backend: Init@components/sync/model/model_type_store_backend.cc:109: IO error: /home/$USER/.config/streamlink-twitch-gui/Default/Sync Data/LevelDB/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
A quick search have shown many lock files laying around there:
~/.config/streamlink-twitch-gui
❯ fd lock
Default/AutofillStrikeDatabase/LOCK
Default/Download Service/EntryDB/LOCK
Default/Extension Rules/LOCK
Default/Extension Scripts/LOCK
Default/Extension State/LOCK
Default/Feature Engagement Tracker/AvailabilityDB/LOCK
Default/Feature Engagement Tracker/EventDB/LOCK
Default/Local Storage/leveldb/LOCK
Default/PersistentOriginTrials/LOCK
Default/Segmentation Platform/SegmentInfoDB/LOCK
Default/Segmentation Platform/SignalDB/LOCK
Default/Segmentation Platform/SignalStorageConfigDB/LOCK
Default/Session Storage/LOCK
Default/Site Characteristics Database/LOCK
Default/Sync Data/LevelDB/LOCK
Default/chrome_cart_db/LOCK
Default/commerce_subscription_db/LOCK
Default/coupon_db/LOCK
Default/discounts_db/LOCK
Default/parcel_tracking_db/LOCK
Default/shared_proto_db/LOCK
Default/shared_proto_db/metadata/LOCK
As this seemed innocuous, I also got rid of them.
After that, Twitch GUI seemed to be able to use the profile again, but now pops this on every start:
Logs have shown some rare coredump of Twitch GUI, probably unrelated.
Now, I don't know enough of the internal structure of the config directory to get rid of this nor understand why does it shows it, and a quick search found threads of close issues, but not the same ones (issues of people having similar error popup but because of nw.js apps with older versions trying to use a profile that have seen newer ones).
So, is there a way to get rid of this/understand why it shows it without wiping user profile? (likely, wiping compltely ~/.config/streamlink-twitch-gui
?
And I'm guessing without interesting logs in journalctl
it'll be difficult finding how this state could have happened to prevent this in the future.
Debug log
No response
This is nothing I can't help with here. This is all Chromium related, so not even NW.js itself.
You have either run into a rare issue with Chromium's shutdown precedure, or you killed the process while it was shutting down.
During a regular shutdown, it'll set all the various databases it has into an expected state and then remove the lockfile after it has finished. Simply removing the main lockfile or any other temporary lockfile won't help you recover any broken states that the databases might be in.
ctrl+q
is an application hotkey for stopping the current stream. Unless your system's window-manager/compositor has its own global hotkey for closing windows/applications, you won't be able to close the application this way.
No idea what you've done, but this sounds more like you've accidentally killed the process while it was shutting down, rather than waiting for its termination, leading to the broken/inconsistent state.
Either way, as said in the beginning, this isn't something I can act on. I myself have never seen any issues with any Chromium-based application leaving a broken state in their config directory, despite killing the processes lots of times in various situations, also during development of Streamlink Twitch GUI.
So all I can tell you is to remove your whole config dir and start anew. The only data you're going to lose is your stored authentication token, any applied (channel-)settings, your search history and the stored window position, which isn't the end of the world. Everything's stored via the DOM's localstorage APIs, so if you feel adventurous, you can try reading that data from the localstorage DBs in the config dir.
In the end, it seems it was linked to one of the encountered crashes that seemed to have resulted in some processes remaining pretty much as zombies. They probably somehow still had a link with the profile, as when I killed it, the issue seemed to have disappeared.
I could spot this with some GPU usage monitor, which also led me to see Twitch GUI is using a bit of GPU, dunno how it can help considering it doesn't show anything with heavy graphical rendering.