Forum Stats

  • 3,768,658 Users
  • 2,252,827 Discussions
  • 7,874,676 Comments

Discussions

SQL Developer can't read files from the /Users/<user name>/Documents folder in Mac OS

JKL
JKL Member Posts: 29 Bronze Badge
edited Nov 6, 2020 8:45PM in SQL Developer

Folks,

I am at a lost and I need some help. I download the latest SQL Developer for Mac, explode the .zip file and I have the SQLDeveloper.app file (well, folder technically in Mac). I then Copy and Paste this into my Application directory and start up the app. Everything runs fine until when I try to open my .sql files or anything in my /Users/<username>/Documents folder.

I know that Mac OS Catalina has new security model where you suppose to grand access to the Documents or Download folder by app. But my previous version runs just fine without this setup. Also, I have tried to grant SQL Developer Full Disk access in the security setting and it is still not working. When I select File -> File Open and then click on the /Users/<user name>/Documents folder, I am getting the following error message:

I/O error:

The directory /Users/<user name>/Documents is not accessible. Please select a different directory.

The strange thing is that I can select files from the /Applications folder or anywhere else except my own user document folder.

I have even tried to grand the JDK java program full disk access and it is still not working properly.

I also have the same issue with the Oracle DataModeler app as well.

Has anyone seen something like this? Any help is greatly appreciated. Thanks in advance.

Tagged:

Best Answer

«1

Answers

  • JKL
    JKL Member Posts: 29 Bronze Badge

    I also tried SQL Developer 19.x version and it is still behaving the same way. Any help is greatly appreciated. Thanks

  • Philipp Salvisberg
    Philipp Salvisberg Member Posts: 156 Silver Badge

    Has anyone seen something like this? 

    I use SQLDev on macOS 10.15.7 and cannot reproduce this issue. Tried with 20.2, 19.4, 19.2.1.

    I know that some users had issues when they used a non-default uid (e.g. 502, default is 501). You can get your uid with following command in a terminal window:

    id -u
    

    I have a separate user with a non default uid (503). I could open files of that user in the Document folder, but of course access to the other user with the default uid (501) was denied. I suggest to check the uid information of the file and directory with

    ls -ln
    

    If the owner uid and the user uid are the same, then I'm running out of ideas.

  • JKL
    JKL Member Posts: 29 Bronze Badge

    Philipp,

    Thanks for your suggestion. My uid 502 is the same as the one listed next to the directory when I do the ls -ln.

    I may need to completely remove SQL Developer including any hidden folder and re-install from scratch again. It has worked before in the past and I don't know which sequence of events changes this. I don't use the tool too often enough to notice the difference on a regular basis.

    Thanks for your response anyway.

  • JKL
    JKL Member Posts: 29 Bronze Badge

    Ok, some more updates. If I just double click the SQLDeveloper.app application icon in the Finder window under Applications, it starts, but with no access to the Document folder.

    However, if I start a Terminal window, cd to /Applications/SQLDeveloper.app/MacOS/ directory and do the ./sqldeveloper command, that session will start SQL Developer properly and it will have access to the Document folder.

    Also, after I grant /usr/bash Full Disk access, this seems to solve the issue where I can just click the SQLDeveloper app icon in the Finder and it will work as expected. But I don't want bash to have full disk access even though technically, this one is owned by "root".

    But I don't want to grant /usr/bash Full Disk access in this fashion and I should not need to. Can anyone shed some lights on this please? Thanks

  • Philipp Salvisberg
    Philipp Salvisberg Member Posts: 156 Silver Badge

    I did some further experiments. When I deny Java the access to the "Documents" folder then I do not see any files via File -> Open... . or in the Files view (in the Documents folder). However I can drag & drop a file from the Finder into an open worksheet. That works.

    When I check "Documents Folder" in the dialog above, then I can see all files in the Documents folder via File -> Open... in SQL Developer.

    I guess in your case the grant to "Documents Folder" is not given. And for some reason macOS does not ask for it anymore.

  • JKL
    JKL Member Posts: 29 Bronze Badge
    edited Nov 11, 2020 4:28PM

    In my case, the Java is already checked for accessing Document folder. But I don't know which version of Java though. Also, strangely, in my case, it only shows that Document folder is available to check, not Desktop and Download folders.

    I cannot manually add the program to the Document and Files section. I can do this with the Full Disk Access. Go figure on the Mac side...:(

    Anyway, thanks for checking into this. I may just keep the bash grant for now to get around it. I am also wondering if there is a plist file somewhere in the Mac that I can update or review to see if the Java program that is checked is indeed the right Java program.

  • adnan645
    adnan645 Member Posts: 478 Bronze Badge

    I am facing the same problem. Provided Full Disk Access to both SQL Developer and Java but still unable to access Desktop, Documents and Downloads from SQL Developer 19.2.1.247


    Previously, it was working fine for macOS Catalina.

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,062 Employee

    When I tried this, it prompted me for permission, I said 'yes' and then the export worked as expected.



  • adnan645
    adnan645 Member Posts: 478 Bronze Badge

    Thanks, I tried with 20.2 as well but I faced same behavior. I even tried to provide access to SQL Developer following Full Disk Access in Preferences>Security and Privacy.

  • JKL
    JKL Member Posts: 29 Bronze Badge
    edited Nov 27, 2020 4:36PM

    Folks,

    So far, the only way that I can get around this issue is to do this:

    I grant /bin/bash Full Disk access, this seems to solve the issue where I can just click the SQLDeveloper app icon in the Finder and it will work as expected.

    But I don't need to do this in the past. Hope this helps some. Thanks