Sequel-ace: The target export folder is not writable.

Created on 17 Jun 2020  路  20Comments  路  Source: Sequel-Ace/Sequel-Ace

I just discovered this fork, after searching for any updates and the development status of the original app and I was happy to see the Ace version.
I started using it right away and I am currently facing an issue.
When I try to export (dump) any tables I get:
"The target export folder is not writable. Please select a new export location and try again."
I tried saving the .sql file on a folder inside my local http docs, then tried to use my desktop as the target folder, then back again in the previous folder by adjusting its permissions.
In all cases I am getting that error message.

  • Sequel Ace Version: 2.0
  • macOS Version: 10.11.6
  • MySQL Version: 5.7.6
Bug Highest Priority Sandboxing

Most helpful comment

@emjayess I also encountered this issue today (having installed Sequel Ace yesterday and imported my preferences from Sequel Pro), and fixed it with two steps. First, in System Preferences -> Security and Privacy -> Privacy tab. Unlock the pane via the lock in the lower-left, and click "Full Disk Access". Click the + button and add Sequel Ace. Restart Sequel Ace. In the export dialog, I had to click the Change... button to the right of the Path field, and re-select the same path that was already in that field before the export would work.

All 20 comments

Oh no! I'm sorry you're having this issue!

Can you try the new version that's pending App Store review and let me know if this fixes the issue? We sandboxed the app compared to Sequel Pro which makes it more secure but has certainly encountered some hurdles!

This beta linked below is still sandboxed and notarized by apple so you should have no issues trying it!

https://github.com/Sequel-Ace/Sequel-Ace/releases/tag/2.0.1-rc1

Hi Jason!
I tried with 2.0.1 - still getting the same issue.

Thank you for trying 2.0.1!
After some investigating, it looks like this is a sandbox issue! Like we're trying to pre-select a path and just let you hit export. In the sandbox world order, we instead shouldn't have a path selector and will have to make the user manually select an export location by navigating to it, perhaps after clicking the "export" button (likely after the file has been build so we can just drop it on the location after building it into a local temp dir). @gboudreau or @jamesstout would either of you be able to look into implementing this?

Is it a simple as configuring the NSOpenPanel with canChooseDirectories = YES? I can take a look.

In the sandbox world once you've asked the user for a folder you can create a security scoped bookmark and save it in your apps preferences; on subsequent runs you can use that bookmark to re-establish rights to access the folder without user intervention

from https://stackoverflow.com/a/19258627

Very weird behaviour.

  1. navigate to desktop, create new folder, open, export = error
  2. navigate to desktop, choose new folder from 1., open, export = error
  3. navigate to desktop, don't select new folder, but it looks like you are in the new folder, but path is actually Desktop, open, export = error
  4. navigate to desktop, choose new folder from 1., open, export = SUCCESS.

This is driving me mad. It's reproducible though.
create new folder in say ~/tmp, choose that folder, fail.
choose ~/tmp, fail
choose ~/tmp/new again, fails.
choose ~/tmp, fail
choose ~/tmp/new again, works.

I've got it working via startAccessingSecurityScopedResource. Just checking for leaks now, not written non-ARC code for a while...

Can you try out this branch? 46e9ab1c01412e10cf1160da47224988cd86270c

@jamesstout Your fix works for me with 2 tiny caveats!

  1. We probably should add the bookmark app and document entitlements to the app. likely will be required to have them for App Store release if using security scoped bookmark access (I had removed them before when we weren't using them - https://github.com/Sequel-Ace/Sequel-Ace/commit/a89002572f6350172f67c6f7b423a603f2e4ded8)
  1. It does _not_ work if you go straight to the export dialog and click export because it fills in a default path (~/Documents for ex.) and doesn't have the bookmark because the user didn't select the path location manually. Probably the tiniest fix is just to not fill in a default export location and throw an error requiring the user to select export location if it's blank?

Overall looks awesome!!

  1. Added. Do we need doc scope? We're not using documents to access folders.
  2. The app stores two locations in prefs: last navigated to folder: NSNavLastRootDirectory and LastExportSettings.exportPath. NSNavLastRootDirectory doesn't seem to be used. The export panel defaults to desktop, otherwise their home directory, then checks for LastExportSettings.exportPath and uses that if set.

We could just not set to desktop/home directory, and then prompt for a location, probably on first ever use. Then, if we're going to use bookmarks, we could store them in prefs, with a use count, then default to the most used location? But keep last used location if they export more than once in a session? Starting to get a bit more complicated.

I'll look at the first use example first, no ~ or ~/Desktop.

Interestingly, if you don't enter a path, no error occurs and it doesn't tell you where it saved it. Had to do a find, but should have realised the file would be in ./Library/Containers/com.sequel-ace.sequel-ace/Data/nextcloud_2020-06-20.sql Which the average user will never find. Even me!

Took me a while to get the alert in the right place, but please take a look at the same fork mentioned above.

https://github.com/Sequel-Ace/Sequel-Ace/compare/dev...jamesstout:target-export-folder?expand=1

Made a few changes to store the bookmarks.

  1. Added. Do we need doc scope? We're not using documents to access folders.
  2. The app stores two locations in prefs: last navigated to folder: NSNavLastRootDirectory and LastExportSettings.exportPath. NSNavLastRootDirectory doesn't seem to be used. The export panel defaults to desktop, otherwise their home directory, then checks for LastExportSettings.exportPath and uses that if set.

We could just not set to desktop/home directory, and then prompt for a location, probably on first ever use. Then, if we're going to use bookmarks, we could store them in prefs, with a use count, then default to the most used location? But keep last used location if they export more than once in a session? Starting to get a bit more complicated.

I'll look at the first use example first, no ~ or ~/Desktop.

Probably don't need doc scope if we're not doing any doc scope bookmarks!

Latest changes to fork worked for me! A little funky workflow that first time getting the error and having to go back and set export location - almost might be better to immediately pop up the export location select the first time if no location selected or something. But it 100% fixes the bug! PR it and will merge! Awesome work, @jamesstout!

I've added a warn user if they have not chosen a directory alert.

wait .. there might be a bug...

UPDATE: maybe not. Might have been my app was in a weird state after starting/stopping debugger.

Hm, just came looking for reports of this issue because I've been experiencing it... still.

Sequel Ace 2.1.7
Build 2077
and Mac Homebrew installed

@emjayess Hmmm, we issues a patch months ago which should have fixed this issue for everyone. You may be experiencing a different issue. Please open a new issue if you're still having this problem and please include the exact steps to reproduce. Feel free to reference this issue in your new issue (#27)

@emjayess I also encountered this issue today (having installed Sequel Ace yesterday and imported my preferences from Sequel Pro), and fixed it with two steps. First, in System Preferences -> Security and Privacy -> Privacy tab. Unlock the pane via the lock in the lower-left, and click "Full Disk Access". Click the + button and add Sequel Ace. Restart Sequel Ace. In the export dialog, I had to click the Change... button to the right of the Path field, and re-select the same path that was already in that field before the export would work.

This happened to me randomly today and @incidentist solution worked for me 馃榾

Was this page helpful?
0 / 5 - 0 ratings