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

Recordings are not saved with the error "Permission denied" when "Automatically save files" is on #175

Open
afonsoguerra opened this issue Oct 11, 2022 · 12 comments

Comments

@afonsoguerra
Copy link

Hi,

I was using your software quite successfully on Ubuntu 22.04. I like the simplicity and the autosave. Unfortunately it self-updated and it stopped saving files. Opening it through the command line shows a permission denied error when saving.

I'm just puzzled as to why this would appear now.

Thanks for any hints

@ryonakano
Copy link
Owner

Hi, thank you for liking my app and your issue report, it makes me even motivated for the development of this app. 😊
And I'm sorry for your inconvenience. Actually I revamped the auto-save functions so that the app don't have unnecessary access permission to the user's data. I meant there are no influences because of this change, but I seemed to miss something here. 😞

Would you tell me more detailed information so that we can dig into this issue, like a screenshot of the Welcome view (where the app shows when it launches)? Also, I'd like to know what the "permission denied error" looks like; I assume it would be an error message shown in the terminal, but could you paste that message here?

@afonsoguerra
Copy link
Author

afonsoguerra commented Oct 13, 2022

Hi,

Thanks for getting back to me so quickly, and for your help getting to the bottom of this. Here is the requested information.

image
This is the only view that I ever have of the app, so I assume that is what you meant.

As for the error, here it is, preceded by the command I'm using to launch the app.
➜ flatpak run com.github.ryonakano.reco

** (com.github.ryonakano.reco:2): WARNING **: 13:55:28.497: MainWindow.vala:152: Error opening file “/run/user/1000/doc/4b422ad3/myRecs/Recording from 2022-10-13 13.55.28.flac”: Permission denied

The path should be in my home directory, so ~/myRecs/...

@ryonakano
Copy link
Owner

Thank you for your information, they would help our investigation.

Another thing I'd like to ask you is: is the "Automatically save files" switch turned off? I assume that switch should be off by default and you turned it on and select the ~/myRecs/ folder from the bottom button.

And another thing I'm wondering is that your recording destination should be ~/myRecs/ as you said and as we can see your "permission denied" error message, but the screenshot is saying "org.gnome.soundrecorder" is the recording destination. 🤔

@afonsoguerra
Copy link
Author

You are correct. I have selected that in the previous version and it was kept when updated.

Sorry for the confusion, I swapped the path after the screenshot just to get to a folder in home where permissions were clearer just to be sure.

@ryonakano
Copy link
Owner

ryonakano commented Oct 17, 2022

Nice, thank you for your information! According to these information you shared, it seems like the recordings don't saved due to the lack of permission. Reco should get access permission to the location where user selected in the file chooser, and it works on elementary OS (which built on Ubuntu), but looks like it don't work on Ubuntu―I was also able reproduce the issue finally:

VirtualBox_Ubuntu 22 04_17_10_2022_20_04_51

In case you need a quick fix for this issue, here is the commands:

flatpak uninstall com.github.ryonakano.reco --delete-data
flatpak install flathub com.github.ryonakano.reco
sudo flatpak override --filesystem=/path/to/your/recording/destination com.github.ryonakano.reco

and then run the app again. Note that the first --delete-data won't remove your data, it removes the app data under ~/.var.

@afonsoguerra
Copy link
Author

Thanks for the quick fix, works great!

Maybe just add a default save directory inside the sandbox and provide instructions on how to give permissions outside the sandbox if needed. That way it will work by default, but also remain flexible otherwise.

If I can just pick your brain for a quick feature request, it would be nice to have some sort of indication of signal, maybe just a little red light when there is speech, something... because I just made a recording without my microphone plugged in and didn't even notice until I saw the file size :)

@ryonakano
Copy link
Owner

Maybe just add a default save directory inside the sandbox

Actually this was the behavior until the previous version―Reco has write access to the entire home directory, and uses ~/Recording directory for the default location. If we revert the new behavior and go back to this previous state, it should work for almost of all people. However, the fundamental issue don't resolved that Reco doesn't get permission when the custom saving location selected―I haven't tried yet but maybe this issue would happen with the previous version of Reco too, if we choose external disk for the default saving location.

Note that both the previous version and the current version works as expected on elementary OS, so there might be some difference between it and Ubuntu…… 🤔

it would be nice to have some sort of indication of signal, maybe just a little red light when there is speech, something...

Nice, you're right, it would help us to know if the recording is ongoing successfully. I'll create a separate issue for this, thank you for your feature request too!

@afonsoguerra
Copy link
Author

Note that both the previous version and the current version works as expected on elementary OS, so there might be some difference between it and Ubuntu…… thinking

Just to point out that I'm using the latest ubuntu 22.04, and elementary (6) is based on the previous LTS (20.04). I used to use elementary, but couldn't gel with the first release of elementary 6 on my touchscreen and went back to ubuntu. But there are likely several differences between ubuntu 20.04 vs 22.04

Thanks for all your work on this!

@canadaduane
Copy link

I just want to add another clue that may be useful here:

I have installed the flatpak on my Pop!_OS (Ubuntu-based) machine and there is no permission issue when the "Automatically save files" checkbox is OFF. However, when it is ON, there is a permission issue.

This surprised me, because I expected that if it was a permissions issue, the destination folder would consistently reject the file and raise an exception.

I guess flatpak must get permission differently if it is through the "Save as" file chooser vs. automatically saving a file.

@johnblommers
Copy link

The Flatseal tool can adjust Reco's Filesystem permissions so it can access "All userfiles" in the user home directory. That worked for me.

@brentstewart
Copy link

Pop 22.04 has this permission issue. The "sudo flatpak override --filesystem=/path/to/your/recording/destination com.github.ryonakano.reco" suggestion did not work for me, but @johnblommers idea did. Used Flatseal to allow access to user files. Thanks for a cool app and thanks to John for his suggestion.

ryonakano added a commit to flathub/com.github.ryonakano.reco that referenced this issue Dec 5, 2023
A temporary workaround of ryonakano/reco#175 while investigating it
@ryonakano
Copy link
Owner

ryonakano commented Dec 9, 2023

Hi, thank you very much for all who commented to this issue! I investigated this issue today and finally I got the reason of issues.
I'll summarize the reason and affected versions here:

Summary

On Reco, recordings are not saved with the error "Permission denied" only when Automatically save files is on

Reason

Because the selected folder is not set as writable, due to an issue of GNOME (xdg-desktop-portal-gnome specifically)

This issue was fixed in this change but only available GNOME >= 44

Affected versions

  • Desktop environments using GNOME (< 44), for example:
    • Ubuntu (< 23.04)
    • Pop!_OS 22.04 LTS (which uses GNOME 42)

elementary OS is also based on Ubuntu but is not affected, because they don't use xdg-desktop-portal-gnome but use their own implementation.

Workaround

You can:

  • use desktop environments using GNOME (>= 44), for example:
    • Ubuntu 23.10 (which uses GNOME 45)
      • I confirmed "Permission denied" message is not shown and recording is save to the specified directory
  • or add permission to the desired folder using Flatseal as @johnblommers commented

Unfortunately there is no "perfect fix" to do in the scope of Reco since this is an issue of GNOME itself. However, Reco published on Flathub now has write access to Home folder by default (this fix) so you don't need the above workaround unless you save to other place like external drive.

@ryonakano ryonakano changed the title New version not saving files, permission denied. Recordings are not saved with the error "Permission denied" when "Automatically save files" is on Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants