# Unauthorized to open sqlite database

**URL:** <https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835>\
**Category:** Support and Helpdesk\
**Created:** [October 21, 2024, 1:59pm UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835 "2024-10-21T13:59:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericleasemorgan](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@ericleasemorgan](https://forum.openrefine.org/u/ericleasemorgan)\
**Post date:** [October 21, 2024, 1:59pm UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/1 "2024-10-21T13:59:13Z")

</div>

I have a set of SQLite databases. I would like to open any one of them, specify a SELECT query, and analyze the results, but when I try to test or connect to the databases I get error:Unauthorized. I am using OpenRefine 3.8.2 on my Macintosh, and the attached image illustrates how I am trying to create the connection to a database file on my Desktop. I can't open a SQLite database.

What am I doing wrong?

 ![connect](https://europe1.discourse-cdn.com/flex017/uploads/openrefine/original/2X/a/a1231e742873841da088c0774a92ea8ac5af30ac.png)

---

<div class="post-metadata">

**Author:** ![thadguidry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/thadguidry/32/653_2.png) [@thadguidry](https://forum.openrefine.org/u/thadguidry)\
**Post date:** [October 22, 2024, 12:33am UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/2 "2024-10-22T00:33:28Z")

</div>

Hi @ericleasemorgan and welcome to OpenRefine!

Do you get a better or different error when you click on the Test button for the connection?

You might also look at running OpenRefine through your terminal on Mac, so that you get console logging and reply back with additional errors or a Java stacktrace that you see: [OpenRefine User Manual - Installing - Logs](https://openrefine.org/docs/manual/installing#logs)

Other than that, with the `error:Unauthorized`, I think the error itself is coming perhaps from the Mac filesystem call, and perhaps that path to the Database file doesn't have the right permissions for read?

I tested with my test file on my Windows system and it works fine with OpenRefine 3.9.0-SNAPSHOT and 3.8.0  
[test.zip](https://forum.openrefine.org/uploads/short-url/oTJIJxcuMvpezBW9KWiHIzczUW1.zip) (517 Bytes)

---

<div class="post-metadata">

**Author:** ![thadguidry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/thadguidry/32/653_2.png) [@thadguidry](https://forum.openrefine.org/u/thadguidry)\
**Post date:** [October 22, 2024, 1:14am UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/3 "2024-10-22T01:14:08Z")

</div>

@tfmorris While testing a few things for this reported issue, I did find an issue with our database access code. SQLite connections remain open and are not properly closed after use (so a SQLite file will remain locked on the filesystem and inaccessible; i.e. you can't move it or compress it, etc.).

I'll open a new issue for this and the fix.

> <https://github.com/OpenRefine/OpenRefine/issues/6922>
>
> While testing a few things for this \[reported SQLite issue on the forum\](https:/…/forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835), I did find an issue with our database access code. SQLite connections remain open and are not properly closed after use (so a SQLite file will remain locked on the filesystem and inaccessible; i.e. you can't move it or compress it, etc.).
> 
> \### To Reproduce
> Steps to reproduce the behavior:
> 1. First, in OpenRefine, create a new connection to a SQLite file on disk
> 2. Then, click on Test button on Database import
> 3. Finally, try to compress the SQLite file on disk 
> 
> 
> \### Current Results
> filesystem ERROR that SQLite file is open and in use.
> 
> 
> \### Expected Behavior
> SQLite file on disk should not remain open and in use after OpenRefine has finished using a database connection to it.
> 
> \### Screenshots
> 
> 
> \### Versions
> - Operating System: Windows 11 Pro
> - Browser Version: Edge Version 130.0.2849.46
> - JRE or JDK Version: openjdk version "21" 2023-09-19 LTS
> - OpenRefine: Version 3.9-SNAPSHOT
> 
> \### Datasets
> \<!-- If you are allowed and are OK with making your data public, it would be awesome if you can include or attach the data causing the issue or a URL pointing to where the data is.
> If you are concerned about keeping your data private, you can share it selectively by email to developers who work on the issue --\>
> SQLite .db test file:
> \[test.zip\](https://github.com/user-attachments/files/17468595/test.zip)
> 
> \### Additional context

---

<div class="post-metadata">

**Author:** ![ericleasemorgan](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@ericleasemorgan](https://forum.openrefine.org/u/ericleasemorgan)\
**Post date:** [October 22, 2024, 1:16am UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/4 "2024-10-22T01:16:17Z")

</div>

Thank you. In the meantime, I will open OpenRefine in the terminal and report back what I find. 'More later. --Eric M.

---

<div class="post-metadata">

**Author:** ![ericleasemorgan](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@ericleasemorgan](https://forum.openrefine.org/u/ericleasemorgan)\
**Post date:** [October 22, 2024, 2:37pm UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/5 "2024-10-22T14:37:07Z")

</div>

Resolved, sort of.

On my two Macintosh computers -- one at home and one at work -- I am now able to create a new project by opening an SQLite database and submitting a query, but only after I launch OpenRefine from the terminal. When I launch OpenRefine from the Finder, I get the "unauthorized" error. Go figure.

---

<div class="post-metadata">

**Author:** ![ericleasemorgan](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@ericleasemorgan](https://forum.openrefine.org/u/ericleasemorgan)\
**Post date:** [October 22, 2024, 2:42pm UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/6 "2024-10-22T14:42:22Z")

</div>

> Other than that, with the error:Unauthorized, I think the error  
> itself is coming perhaps from the Mac filesystem call, and  
> perhaps that path to the Database file doesn't have the right  
> permissions for read?

Doesn't have permission to read? That's possible.

Recently, say in the past year, it is not uncommon for me to download an application from the 'Net, launch it, and then try to open a file. When I do so, Mac OS often comes back with something like, "Do you want to give Application permission to read from the Desktop?" In this case, maybe OpenRefine needs to be authorized in some way by the Macintosh operating system.

---

<div class="post-metadata">

**Author:** ![thadguidry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/thadguidry/32/653_2.png) [@thadguidry](https://forum.openrefine.org/u/thadguidry)\
**Post date:** [October 23, 2024, 1:35am UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/7 "2024-10-23T01:35:15Z")

</div>

Yes, we are aware of the unnotarized application warning, and this should be eventually fixed. You can track the issue

> <https://github.com/OpenRefine/OpenRefine/issues/6713>
>
> Hi:
> 
> Thanks for developing and making OpenRefine available to the community.
> …
> There is an OpenRefine 3.8.2 Mac application that is not notarized correctly. The app or component was signed with an Apple-issued Developer ID certificate but does not appear to be notarized. Since the exceptions described above for the Developer ID status are not met, macOS will not allow this code to run (unless it is found to be notarized when Gatekeeper runs).
> 
> To verify if a Mac application is notarized, you can use the spctl command in Terminal. Here is the command:
> 
> \`\`\`
> spctl -a -v /path/to/application.app
> \`\`\`
> 
> For example, executing the command with OpenRefine 3.8.2 outputs...
> 
> \`\`\`
> spctl -a -v /Volumes/OpenRefine/OpenRefine.app   
> /Volumes/OpenRefine/OpenRefine.app: rejected
> source=Unnotarized Developer ID
> \`\`\`
> 
> Additional context
> 
> Here is some interesting general information to checkout and share with your macOS developer on resolving Gatekeeper problems on macOS.
> 
> Resolving Gatekeeper Problems | Apple Developer Forums:
> 
> The post titled "Resolving Gatekeeper Problems" on the Apple Developer Forums, written by Quinn "The Eskimo!" from Developer Technical Support at Apple is a comprehensive guide addressing common issues related to Gatekeeper on macOS. Gatekeeper is a security feature designed to ensure that only trusted software runs on a user's Mac, and the post focuses on helping developers troubleshoot and resolve issues that may arise in this context.
> 
> The post identifies four common Gatekeeper problems that developers may encounter:
> 
> App blocked by a dangling load command path.
> Broken code signature.
> Lack of notarization.
> Command-line tool blocked by Gatekeeper.
> For each of these issues, the post provides detailed steps and guidance on how developers can resolve them. The emphasis is on the importance of passing Gatekeeper checks to maintain customer trust and avoid potential loss of customers.
> Key points covered in the post include:
> 
> • Verification of Code Signature: Developers are advised to use the codesign tool to verify that their code is signed correctly. The post provides examples of command-line usage to check for issues such as missing or invalid sealed resources.
> • Notarization Issues: Gatekeeper requires that apps be notarized, and the post guides developers on how to identify and resolve notarization problems. It includes information on checking system logs for specific entries related to notarization issues.
> • Hash Mismatch: In cases where there's a hash mismatch, the post provides guidance based on the file type (e.g., zip archive, signed disk image, installer package) and recommends specific actions to address the problem.
> • Command-line Tool Blocking Bug: A known bug in macOS is acknowledged, where double-clicking a command-line tool in Finder may lead to it being blocked by Gatekeeper. Workarounds, such as embedding the tool in an application or using an installer package, are suggested.
> 
> Throughout the post, there are references to Apple's documentation and resources related to code signing and notarization, providing developers with additional information for a deeper understanding.
> 
> https://forums.developer.apple.com/forums/thread/706379

Additional context from other users recently:

> [@Installing OpenRefien on MacOs Ventura](https://forum.openrefine.org/t/installing-openrefien-on-macos-ventura/1771):
>
> I am trying to install OpenRefine using the latest version on my MacOS Ventura but I get an error message. I uploaded a screen shot. It says "Open Refine cannot be opened because Apple cannot check it for malicious software." Can you help? I tried an older version of OpenRefine and that installed but not the newer one.

---

<div class="post-metadata">

**Author:** ![Antoine2711](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openrefine.org/antoine2711/32/85_2.png) [@Antoine2711](https://forum.openrefine.org/u/Antoine2711)\
**Post date:** [October 28, 2024, 7:08am UTC](https://forum.openrefine.org/t/unauthorized-to-open-sqlite-database/1835/8 "2024-10-28T07:08:38Z")

</div>

What version of MacOS are you using? 14.7, Sonoma, or 15, Sequoia?

Regards, Antoine
