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

Error: unable to open database file (code 14) #6

Closed
FixGN opened this issue Jan 7, 2023 · 2 comments
Closed

Error: unable to open database file (code 14) #6

FixGN opened this issue Jan 7, 2023 · 2 comments

Comments

@FixGN
Copy link

FixGN commented Jan 7, 2023

OS: Windows 11 Enterprise
OS version: 22000.1335

When I try to run app, I get an error "Error: unable to open database file (code 14)"

Example:

cargo run --release -- --dir=test_data
warning: unused imports: `Frame`, `Rect`
 --> src\app\ui.rs:5:45
  |
5 |     layout::{Constraint, Direction, Layout, Rect},
  |                                             ^^^^
...
9 |     Frame, Terminal,
  |     ^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::thread`
  --> src\app\mod.rs:14:5
   |
14 | use std::thread;
   |     ^^^^^^^^^^^

warning: unused import: `std::time::Duration`
  --> src\app\mod.rs:15:5
   |
15 | use std::time::Duration;
   |     ^^^^^^^^^^^^^^^^^^^

warning: unused imports: `Block`, `Borders`, `Widget`
  --> src\app\mod.rs:18:15
   |
18 |     widgets::{Block, Borders, Widget},
   |               ^^^^^  ^^^^^^^  ^^^^^^

warning: unused import: `Backend`
 --> src\app\ui.rs:4:15
  |
4 |     backend::{Backend, CrosstermBackend},
  |               ^^^^^^^

warning: associated function `cleanup` is never used
  --> src\app\mod.rs:39:8
   |
39 |     fn cleanup(term: &mut Terminal<CrosstermBackend<io::Stdout>>) -> Result<()> {
   |        ^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: associated function `render_cycle` is never used
  --> src\app\mod.rs:51:8
   |
51 |     fn render_cycle(term: &mut Terminal<CrosstermBackend<io::Stdout>>) -> Result<()> {
   |        ^^^^^^^^^^^^

warning: associated function `init_render_loop` is never used
  --> src\app\mod.rs:58:8
   |
58 |     fn init_render_loop(term: &mut Terminal<CrosstermBackend<io::Stdout>>) -> Result<()> {
   |        ^^^^^^^^^^^^^^^^

warning: associated function `init_terminal` is never used
  --> src\app\mod.rs:69:8
   |
69 |     fn init_terminal() -> Result<Terminal<CrosstermBackend<io::Stdout>>> {
   |        ^^^^^^^^^^^^^

warning: struct `EventHandler` is never constructed
 --> src\app\event_handler.rs:7:12
  |
7 | pub struct EventHandler;
  |            ^^^^^^^^^^^^

warning: associated function `init` is never used
  --> src\app\event_handler.rs:10:12
   |
10 |     pub fn init() -> Result<events::Event> {
   |            ^^^^

warning: associated function `handle_keypress` is never used
  --> src\app\event_handler.rs:21:8
   |
21 |     fn handle_keypress(keyevent: KeyEvent) -> Result<events::Event> {
   |        ^^^^^^^^^^^^^^^

warning: enum `Event` is never used
 --> src\app\events.rs:1:10
  |
1 | pub enum Event {
  |          ^^^^^

warning: struct `Ui` is never constructed
  --> src\app\ui.rs:12:12
   |
12 | pub struct Ui;
   |            ^^

warning: associated function `generate_file_list` is never used
  --> src\app\ui.rs:15:8
   |
15 |     fn generate_file_list() -> impl Widget {
   |        ^^^^^^^^^^^^^^^^^^

warning: associated function `generate_info_bar` is never used
  --> src\app\ui.rs:27:8
   |
27 |     fn generate_info_bar() -> impl Widget {
   |        ^^^^^^^^^^^^^^^^^

warning: associated function `generate_file_desc` is never used
  --> src\app\ui.rs:31:8
   |
31 |     fn generate_file_desc() -> impl Widget {
   |        ^^^^^^^^^^^^^^^^^^

warning: associated function `render_frame` is never used
  --> src\app\ui.rs:35:12
   |
35 |     pub fn render_frame(term: &mut Terminal<CrosstermBackend<io::Stdout>>) -> Result<()> {
   |            ^^^^^^^^^^^^

warning: `deduplicator` (bin "deduplicator") generated 18 warnings
    Finished release [optimized] target(s) in 0.30s
     Running `target\release\deduplicator.exe --dir=test_data`
Error: unable to open database file (code 14)
error: process didn't exit successfully: `target\release\deduplicator.exe --dir=test_data` (exit code: 1)

I tried to install app via cargo, also I tried to build app from source code, but I got the same error.

How can I fix it?

@sreedevk
Copy link
Owner

sreedevk commented Jan 8, 2023

@FixGN I've not tested it on windows, but I know the issue. The app uses sqlite underneath. If the --nocache options is not passed, deduplicator tries to create a DB at "/tmp/deduplicator.db" which is not a valid path on windows. There are other parts of the app that will cause deduplicator to crash on windows systems. I'm working on adding support for windows systems. Will keep this issue open until I fix it. Thank you for raising the issue!

sreedevk added a commit that referenced this issue Jan 9, 2023
@sreedevk
Copy link
Owner

sreedevk commented Jan 9, 2023

#12 fixes this

@sreedevk sreedevk closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants