Skip to content

unable to get table names: disk I/O error #5

@lucaspiller

Description

@lucaspiller

I'm getting this error when trying to generate the models. Not exactly sure what's going on, as everything looks fine to me. I've tried removing the packages (including go-sqlite3) and reinstalling but it doesn't make any difference.

$ go get -u github.com/volatiletech/sqlboiler

$ go get -u github.com/volatiletech/sqlboiler-sqlite3 

$ cat sqlboiler.toml
[sqlite3]
dbname = "/home/luca/Pictures/pixels.sqlite3"

$ sqlboiler sqlite3 --wipe -d                                                                                                                                                                      
using driver: /home/luca/src/go/bin/sqlboiler-sqlite3                                                                                                                                                                                   
unable to get table names: disk I/O error                                                                                                                                                                                               
{"config":{"driver_name":"sqlite3","driver_config":{"blacklist":null,"dbname":"/home/luca/Pictures/pixels.sqlite3","whitelist":null},"pkg_name":"models","out_folder":"models","debug":true,"wipe":true,"struct_tag_casing":"snake","imp
orts":{"all":{"Standard":["\"database/sql\"","\"fmt\"","\"reflect\"","\"strings\"","\"sync\"","\"time\""],"ThirdParty":["\"github.com/pkg/errors\"","\"github.com/volatiletech/sqlboiler/boil\"","\"github.com/volatiletech/sqlboiler/qu
eries\"","\"github.com/volatiletech/sqlboiler/queries/qm\"","\"github.com/volatiletech/sqlboiler/queries/qmhelper\"","\"github.com/volatiletech/sqlboiler/strmangle\""]},"test":{"Standard":["\"bytes\"","\"reflect\"","\"testing\""],"T
hirdParty":["\"github.com/volatiletech/sqlboiler/boil\"","\"github.com/volatiletech/sqlboiler/queries\"","\"github.com/volatiletech/sqlboiler/randomize\"","\"github.com/volatiletech/sqlboiler/strmangle\""]},"singleton":{"boil_querie
s":{"Standard":null,"ThirdParty":["\"github.com/volatiletech/sqlboiler/drivers\"","\"github.com/volatiletech/sqlboiler/queries\"","\"github.com/volatiletech/sqlboiler/queries/qm\""]},"boil_types":{"Standard":["\"strconv\""],"ThirdPa
rty":["\"github.com/pkg/errors\"","\"github.com/volatiletech/sqlboiler/boil\"","\"github.com/volatiletech/sqlboiler/strmangle\""]}},"test_singleton":{"boil_main_test":{"Standard":["\"database/sql\"","\"flag\"","\"fmt\"","\"math/rand
\"","\"os\"","\"path/filepath\"","\"strings\"","\"testing\"","\"time\""],"ThirdParty":["\"github.com/spf13/viper\"","\"github.com/volatiletech/sqlboiler/boil\""]},"boil_queries_test":{"Standard":["\"bytes\"","\"fmt\"","\"io\"","\"io
/ioutil\"","\"math/rand\"","\"regexp\""],"ThirdParty":["\"github.com/volatiletech/sqlboiler/boil\""]},"boil_suites_test":{"Standard":["\"testing\""],"ThirdParty":null}}},"aliases":{}},"driver_config":{"blacklist":null,"dbname":"/hom
e/luca/Pictures/pixels.sqlite3","whitelist":null},"schema":"","dialect":{"lq":0,"rq":0,"use_index_placeholders":false,"use_last_insert_id":false,"use_schema":false,"use_default_keyword":false,"use_auto_columns":false,"use_top_clause
":false,"use_output_clause":false,"use_case_when_exists_clause":false},"tables":null,"templates":null}                                                                                                                                  
Error: exit status 1                                                                                                                                                                                                                    
driver (/home/luca/src/go/bin/sqlboiler-sqlite3) exited non-zero                                                                                                                                                                        
github.com/volatiletech/sqlboiler/drivers.execute
/home/luca/src/go/pkg/mod/github.com/volatiletech/sqlboiler@v3.4.0+incompatible/drivers/binary_driver.go:73

I've tried deleting and recreating the database in case anything is messed up there, but it looks fine:

$ sqlite3 /home/luca/Pictures/pixels.sqlite3 .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE migrations(
                                version INT NOT NULL PRIMARY KEY,
                                migrated_at INTEGER NOT NULL
                        );
INSERT INTO migrations VALUES(1,1560773272);
CREATE TABLE photos (
                                id UUID NOT NULL PRIMARY KEY,
                                path TEXT NOT NULL,
                                exif_parsed_at INTEGER,
                                taken_at TIMESTAMP,
                                width INTEGER,
                                height INTEGER,
                                camera_make TEXT,
                                camera_model TEXT,
                                f_number REAL,
                                exposure_time_string TEXT,
                                exposure_time REAL,
                                focal_length REAL,
                                iso INTEGER,
                                orientation INTEGER,
                                latitude REAL,
                                longitude REAL,
                                created_at INTEGER NOT NULL,
                                updated_at INTEGER NOT NULL,
                                UNIQUE(path)
                        );
COMMIT;

Versions:

$ sqlboiler --version
SQLBoiler v3.4.0

$ sqlite3 --version
3.28.0 2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions