Save Path Changes and Causes Error Randomly
Flameshot Version
Flameshot v12.1.0 (Debian 12.1.0-build2) Compiled with Qt 5.15.12
Installation Type
AppImage, Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)
Operating System type and version
Xubuntu 24.04.2 LTS
Description
Save path in the configuration is randomly changed to a folder that does not exist. Initial save path set as /tmp. After some time flameshot displays an error and the save path is changed to /tmp/cal.
Steps to reproduce
No response
Screenshots or screen recordings
No response
System Information
Xubuntu 24.04.2 LTS
can you also share your flameshot.ini config file. It should be in ~/.config/flameshot/.
Also, please always take time and fill the requested information in the form. You left major parts out. Bug reports that are not filled properly are invalid, especially if we don't have the information that we need to reproduce the issue.
Thank you. I apologize about the missing information. I am happy to get you anymore you need.
Before the path changes
[General]
buttons=@Variant(\0\0\0\x7f\0\0\0\vQList
After the path changes
[General]
buttons=@Variant(\0\0\0\x7f\0\0\0\vQList
Just to make sure, this is your entire configuration file right? You have no filenamePattern etc. set?
That is correct.
Is there anymore information needed?
How did you install ?
sudo apt install flameshot
I made a quick VM and clean install Xubuntu 24.04 and tried the following:
sudo apt update \
&& sudo apt upgrade \
&& sudo apt install flameshot \
&& reboot # just in case
and when the VM booted, I opened a terminal and ran flameshot and then went to config, it shows the ~/Pictures/ and also when I click on the tray icon and take a screenshot, it by default goes to ~/Pictures/ too. Therefore, I could not reproduce the issue.
@Cboughton Can you provide some further information on how this can be reproduced? Does it happen after every reboot, or after any specific event?
@Cboughton Maybe you could use inotify to see when the config file changes, and what process is changing it?
@Cboughton You can use this example if you don't know how to work with what @borgmanJeremy suggested:
sudo apt install inotify-tools
touch ~/flameshot-config-change.log \
&& inotifywait --daemon \
--outfile ~/flameshot-config-change.log \
--timefmt '%Y-%m-%d %H:%M:%S' \
--format '[%T] %w - %e%n' \
--event modify \
~/.config/flameshot/flameshot.ini
What this does is that:
- installs the inotify-tools to ease your usage
- create a log file names
~/flameshot-config-change.log - using
inotifywait, create a daemon that in the background looks for the changes to~/.config/flameshot/flameshot.iniand stores them with date and time in the log file
You can monitor the log file using tail -f '~/flameshot-config-change.log' and it will produce and output like the following if the file is modified:
[2025-03-12 15:40:57] /home/mm/.config/flameshot/flameshot.ini - MODIFY
I have not been able to find a trigger for this. It happens at random intervals and is not dependent on reboots. I have set up inotify to monitor when the config file changes and will update when I have more information.
I've checked the code that would be able to change the savePath. Aside from the configuration manager it's only here which only takes the directory of the saved file and sets it as the savepath. I can't figure out how this would trigger without specifically being called and showing a GUI.
Unfortunately we will have to wait for it to happen again so that we can see if it's caused by flameshot itself.
The save path was changed again at 16:30 on 2025-05-14. Theese are the logs from 16:37 2025-05-14
[2025-05-14 07:15:03] /home/X/.config/flameshot/flameshot.ini - OPEN
[2025-05-14 07:15:03] /home/X/.config/flameshot/flameshot.ini - ACCESS
[2025-05-14 07:15:03] /home/X/.config/flameshot/flameshot.ini - CLOSE_NOWRITE,CLOSE
[2025-05-14 12:42:14] /home/X/.config/flameshot/flameshot.ini - OPEN
[2025-05-14 12:42:14] /home/X/.config/flameshot/flameshot.ini - ACCESS
[2025-05-14 12:42:14] /home/X/.config/flameshot/flameshot.ini - CLOSE_NOWRITE,CLOSE
[2025-05-14 13:42:45] /home/X/.config/flameshot/flameshot.ini - OPEN
[2025-05-14 13:42:45] /home/X/.config/flameshot/flameshot.ini - ACCESS
[2025-05-14 13:42:45] /home/X/.config/flameshot/flameshot.ini - CLOSE_NOWRITE,CLOSE
[2025-05-14 14:36:05] /home/X/.config/flameshot/flameshot.ini - OPEN
[2025-05-14 14:36:05] /home/X/.config/flameshot/flameshot.ini - ACCESS
[2025-05-14 14:36:05] /home/X/.config/flameshot/flameshot.ini - CLOSE_NOWRITE,CLOSE
Does it say which process opened and modified it? If not is there a way to enable that?
Edit: and were you actively using flameshot at the time?
It does not say which process opened and modified it.
I'm not sure when the change occurred either as it was noticed at 16:30 when a screen shot was attempted. I am reporting this for a client and have limited informaiton.
@Cboughton I think if you are on a systemd machine you can use auditctl:
# to see the status (first line tells you if it is enabled
sudo auditctl -s
# add the rule for watching the flameshot.ini for user X on write and attribute changes
sudo auditctl -a always,exit -F arch=b64 -F path=/home/X/.config/flameshot/flameshot.ini -F perm=wa
# list the rules and confirm ours is added
sudo auditctl -l
Now, if the auditctl was not enabled, but enable it:
sudo auditctl -e 1
and if the auditd.service is not running, start that too:
sudo systemctl start auditd.service
and in theory you should be able to see the logs using ausearch and filtering by file path:
sudo ausearch -f /home/X/.config/flameshot/flameshot.ini
and at the end when you are done, just delete the rules:
sudo auditctl -D
Disclaimer: I tried to get it working on my computer on a test file, but I didn't manage to get it working. Here are the sources I used:
- https://www.redhat.com/en/blog/configure-linux-auditing-auditd - Containes old syntax of
auditctl, but if you are on an old distro this might still work - https://linux-audit.com/linux-audit-framework/configuring-and-auditing-linux-systems-with-audit-daemon/
- https://www.namehero.com/blog/getting-started-with-auditctl-on-linux/
- https://commandmasters.com/commands/auditctl-linux/ - I found this the most comprehensive