[sqlite] SQLITE_CANTOPEN on Android

2016-04-25 Thread Clemens Ladisch
Martin Trnovec wrote: > D?a 24.04.2016 o 8:39 Clemens Ladisch nap?sal(a): >> Android (and Chromium on Android) just use SQLITE_TEMP_STORE=3 for this >> reason >> >> Apparently, Martin's SQLite library was compiled differently. > > That's right we have our own build of sqlite included in c++ common

[sqlite] SQLITE_CANTOPEN on Android

2016-04-24 Thread Martin Trnovec
D?a 24.04.2016 o 8:39 Clemens Ladisch nap?sal(a): > Richard Hipp wrote: >> On 4/22/16, Christian Werner wrote: >>> On 04/22/2016 03:46 PM, Richard Hipp wrote: Why isn't /var/tmp or /tmp usable on Android? >>> There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst >>> alternatives

[sqlite] SQLITE_CANTOPEN on Android

2016-04-24 Thread Clemens Ladisch
Richard Hipp wrote: > On 4/22/16, Christian Werner wrote: >> On 04/22/2016 03:46 PM, Richard Hipp wrote: >>> Why isn't /var/tmp or /tmp usable on Android? >> >> There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst >> alternatives >> is to use the application's own directory or better

[sqlite] SQLITE_CANTOPEN on Android

2016-04-23 Thread Christian Werner
On 04/23/2016 02:10 PM, Richard Hipp wrote: > Is there a well-defined way to find the name of the application's own > directory? The SDL2 library uses this approach http://www.androwish.org/index.html/artifact/f90b192eadfe588218283717932d35528d84c715?txt=1&ln=1637-1682 i.e. calls android.conte

[sqlite] SQLITE_CANTOPEN on Android

2016-04-23 Thread Richard Hipp
On 4/22/16, Christian Werner wrote: > On 04/22/2016 03:46 PM, Richard Hipp wrote: > >> Why isn't /var/tmp or /tmp usable on Android? > > There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst > alternatives > is to use the application's own directory or better the subdir "cache" > there

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Christian Werner
On 04/22/2016 03:46 PM, Richard Hipp wrote: > Why isn't /var/tmp or /tmp usable on Android? There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst alternatives is to use the application's own directory or better the subdir "cache" therein. Best, Christian

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
Yes looks like that "." folder is correctly detected to not have access and sqlite returns "error: SQLITE_IOERR: disk I/O error" which confirms the fix but still is there a preffered way how to set directory for those transition files , should we use env "SQLITE_TMPDIR" or is there a better w

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
It seems that the problem is/was that the application can't create transient files in the "." directory returned by os_unix.c::unixTempFileDir due to Android os file restrictions. It also looks like that this function is not able to correctly check if the folder is writable for transient files

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Simon Slavin
On 22 Apr 2016, at 2:39pm, Martin Trnovec wrote: > but still is there a preffered way how to set directory for those transition > files , should we use env "SQLITE_TMPDIR" or is there a better way? Also, when is that variable read ? Is it read in sqlite3_initialize(), so you have to set it b

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
Hello, we are using sqlite 3.12.1 on Android device and we are tring to copy content of the one table into another table using INSERT OR REPLACE INTO SELECT * FROM This commad will fail on Android with error code SQLITE_CANTOPEN when - has any triggers configured (also empty one like "se

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > > but still is there a preffered way how to set directory for those > transition files , should we use env "SQLITE_TMPDIR" or is there a > better way? Setting SQLITE_TMPDIR is the preferred way. Why isn't /var/tmp or /tmp usable on Android? -- D. Richard Hip

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > It seems that the problem is/was that the application can't create > transient files in the "." directory returned by > os_unix.c::unixTempFileDir due to Android os file restrictions. Does the fix at https://www.sqlite.org/src/info/67985761aa93fb61 help? > It

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > Hello, > > we are using sqlite 3.12.1 on Android device and we are tring to copy > content of the one table into another table using > > INSERT OR REPLACE INTO SELECT * FROM > > This commad will fail on Android with error code SQLITE_CANTOPEN when >- has

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-14 Thread Andrew Miles
Yes I can see it now with lsof on the process. Ok non-sqlite issue, now to find where I'm not closing the file properly. Thanks for assistance all! Andy > errno 24 is EMFILE "Too many open files". You almost certainly have a ? file-descriptor leak. > > -scott On 14 October 2015 at 08:52, A

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-14 Thread Andrew Miles
Sorry didn't see previous replies before sending. I'll try next: 1) When the error occurs to create a new file in the directory 2) Check lsof of main and monitoring process to see if either is leaking files Get back to you in a few days Thanks Andy On 14 October 2015 at 08:52, Andrew Miles

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-14 Thread Andrew Miles
Fully opening the directory failed to fix the issue. So in summary the program works for days then dies with this in the log: (14) cannot open file at line 28488 of [f5b5a13f73] (14) os_unix.c:28488: (24) open(/usr/share/cm160) - (14) cannot open file at line 28488 of [f5b5a13f73] (14) os_unix.c:

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-14 Thread Scott Hess
errno 24 is EMFILE "Too many open files". You almost certainly have a file-descriptor leak. -scott On Wed, Oct 14, 2015 at 12:52 AM, Andrew Miles wrote: > Fully opening the directory failed to fix the issue. So in summary the > program works for days then dies with this in the log: > > (14)

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-13 Thread Simon Slavin
On 13 Oct 2015, at 6:32pm, Scott Hess wrote: > This implies that the process was previously able to open journal files in > that directory. Having access rights to the database files change for no > reason is concerning, but so is having them not change but it just doesn't > work! You might wa

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-13 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/11/2015 12:56 PM, Andrew Miles wrote: >>> 5) I ran lsof on the db, only one process (this one) had the >>> file open Have you run lsof on your monitoring process? You may be running out of file descriptors that are accessing other files or netw

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-13 Thread Scott Hess
On Sun, Oct 11, 2015 at 12:56 PM, Andrew Miles wrote: > Log showed it unable to open the directory and then unable to write the > journal file. The directory is root writable and the process is run as > root so I didn't expect a problem here. I've now modified the directory > access to be writa

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-11 Thread Andrew Miles
Thanks Log showed it unable to open the directory and then unable to write the journal file. The directory is root writable and the process is run as root so I didn't expect a problem here. I've now modified the directory access to be writable by all to see if that changes things. Andy On 5 Oc

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-05 Thread Andrew Miles
Hi I have a strange issue with a piece of C code using sqlite3. The code runs for days and then stops on an SQL insert into db with the error code SQLITE_CANTOPEN. Further info: 1) The program is a status monitoring app - it writes values into the SQL db once every 60 seconds. Average duration

[sqlite] SQLITE_CANTOPEN after days of operation

2015-10-05 Thread Richard Hipp
On 10/5/15, Andrew Miles wrote: > Hi > > I have a strange issue with a piece of C code using sqlite3. The code runs > for days and then stops on an SQL insert into db with the error code > SQLITE_CANTOPEN. > > Further info: > > 1) The program is a status monitoring app - it writes values into the

Re: [sqlite] SQLITE_CANTOPEN on an open database

2011-06-20 Thread Ian Hardingham
Thanks Jay, that clears things up for me. On 20/06/2011 14:17, Jay A. Kreibich wrote: > On Mon, Jun 20, 2011 at 02:04:36PM +0100, Ian Hardingham scratched on the > wall: >> Hey guys. >> >> We revisit my situation - I'm accessing the same database with 4 >> processes and they are using busy-waitin

Re: [sqlite] SQLITE_CANTOPEN on an open database

2011-06-20 Thread Jay A. Kreibich
On Mon, Jun 20, 2011 at 02:04:36PM +0100, Ian Hardingham scratched on the wall: > Hey guys. > > We revisit my situation - I'm accessing the same database with 4 > processes and they are using busy-waiting to access the db somewhat > concurrently. > > I'm expecting SQLITE_LOCKED and SQLITE_BUSY,

[sqlite] SQLITE_CANTOPEN on an open database

2011-06-20 Thread Ian Hardingham
Hey guys. We revisit my situation - I'm accessing the same database with 4 processes and they are using busy-waiting to access the db somewhat concurrently. I'm expecting SQLITE_LOCKED and SQLITE_BUSY, but I also get SQLITE_CANTOPEN - this is on an *already open* database and a query shortly

Re: [sqlite] SQLITE_CANTOPEN

2011-05-18 Thread Simon Slavin
On 18 May 2011, at 9:09pm, Brancke, Brad wrote: > Once in a while when we power on the device and start my application, > this query fails: > > "SELECT storage_enum, mode, GPSDisplayDMS, UserRealID, UserEffID FROM > Settings;" > > with the reason "unable to open database file" I assume that t

[sqlite] SQLITE_CANTOPEN

2011-05-18 Thread Brancke, Brad
Dear SQL gurus - I have been using SQLite for several years and love it. Currently it is being used on a small embedded Linux device. Once in a while when we power on the device and start my application, this query fails: "SELECT storage_enum, mode, GPSDisplayDMS, UserRealID, UserEffID FROM

[sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Yoav Apter
Thanks. It is indeed a problem with a temp file - I set the temporary directory with an uninitialized value. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Jay A. Kreibich
On Thu, Jul 15, 2010 at 04:35:56PM +0300, Yoav Apter scratched on the wall: > Using ProcMon we notice that when this happens, Sqlite is trying to > open a new file with a gibberish name which explains the OS error. > At what time does sqlite3_step needs top open a file (considering > the database

Re: [sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Dan Kennedy
On Jul 15, 2010, at 8:35 PM, Yoav Apter wrote: > Hi > > We are building a Windows application using a read-only Sqlite > database. When executing many queries in a short time, we sometimes > get SQLITE_CANTOPEN from sqlite3_step. Checking GetLastError gives > us error code 123: The filename

[sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Yoav Apter
Hi We are building a Windows application using a read-only Sqlite database. When executing many queries in a short time, we sometimes get SQLITE_CANTOPEN from sqlite3_step. Checking GetLastError gives us error code 123: The filename, directory name, or volume label syntax is incorrect. If we op

Re: [sqlite] SQLITE_CANTOPEN Bohrbug [RESOLVED]

2010-01-14 Thread Jamie Hardt
On Jan 14, 2010, at 4:45 AM, D. Richard Hipp wrote: > Another possibility: You are using up all of your file descriptors. > Are you sure there is no file descriptor leak in your path enumeration > code? That appears to be exactly what was going on; my code for opening files for reading an

Re: [sqlite] SQLITE_CANTOPEN Bohrbug

2010-01-14 Thread D . Richard Hipp
On Jan 14, 2010, at 7:44 AM, D. Richard Hipp wrote: > > On Jan 14, 2010, at 12:06 AM, Jamie Hardt wrote: >> >> So, has anyone else run into SQLITE_CANTOPEN in a situation where >> it wasn't a permissions issue? >> > > > My guess would be that the SQLite database is located in the same > direc

Re: [sqlite] SQLITE_CANTOPEN Bohrbug

2010-01-14 Thread D. Richard Hipp
On Jan 14, 2010, at 12:06 AM, Jamie Hardt wrote: > > So, has anyone else run into SQLITE_CANTOPEN in a situation where it > wasn't a permissions issue? > My guess would be that the SQLite database is located in the same directory hierarchy that you are indexing and that somehow the system

[sqlite] SQLITE_CANTOPEN Bohrbug

2010-01-13 Thread Jamie Hardt
Hello all- Bear with me, my problem is a little goofy and has stolen six hours of my life. I'm using the C API of sqlite 3.6.12 on Mac OS X 10.6.2. I'm using a sqlite database table to collect paths from a filesystem. So, I have some C code that opens the database at the beginning of an index

Re: [sqlite] SQLITE_CANTOPEN error / bug?

2009-04-17 Thread Filip Navara
Proposed fix: --- os_win.old 2009-04-09 20:41:18.0 +0200 +++ os_win.c2009-04-17 16:33:47.904710700 +0200 @@ -1317,7 +1317,7 @@ }else{ dwCreationDisposition = OPEN_EXISTING; } - if( flags & SQLITE_OPEN_MAIN_DB ){ + if( !(flags & SQLITE_OPEN_EXCLUSIVE) ){ dwShareMode =

Re: [sqlite] SQLITE_CANTOPEN error / bug?

2009-04-17 Thread Filip Navara
Hi again, the bug was introduced in revision 1.573 of pager.c. Best regards, Filip Navara On Fri, Apr 17, 2009 at 2:26 PM, Filip Navara wrote: > > Hello, > > today I tried to upgrade our software from SQLite version 3.6.3 to version > 3.6.13 and I am hitting a race condition that I believe is

[sqlite] SQLITE_CANTOPEN error / bug?

2009-04-17 Thread Filip Navara
Hello, today I tried to upgrade our software from SQLite version 3.6.3 to version 3.6.13 and I am hitting a race condition that I believe is a bug in the library. The library is compiled as thread-safe (and it's reproducible even with the precompiled DLL). Sometimes sqlite3_step fails with SQLITE_

[sqlite] SQLITE_CANTOPEN error in sqlite3_exec function.

2007-03-12 Thread Krishnaveni N
Hello, I am using some of the functions from C/C++ interface of SQLite3. While inserting or updating the database randomly some times it returns error code 14 ie SQLITE_CANTOPEN error. To execute SQL query I am using sqlite3_exec function. ret = sqlite3_exec(mDataBaseConnection, sqlQuery

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread Christiane Lemke
> make sure your /tmp directory is writable. Also make sure you > are able to create new files in the directory that contains the > database file itself. That's it! I did not know that one has to be able to create files in the directory with the database, I thought the right permissions on the da

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread drh
Christiane Lemke <[EMAIL PROTECTED]> wrote: > > Are you *sure* the database is an SQLite3 database and not an SQLite2 > > database? > > No, I'm not, I have to use a database created somewhere else. How can I > tell? > > Anyway, I can open and read the database without any problems with the > sqli

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread Christiane Lemke
> Are you *sure* the database is an SQLite3 database and not an SQLite2 > database? No, I'm not, I have to use a database created somewhere else. How can I tell? Anyway, I can open and read the database without any problems with the sqlite3 C++ API, just modifying does not seem to work. I can al

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread Christiane Lemke
> You gave no details. > > Did you open the database first? All right, I'm sorry, here is a more complete code snip to illustrate my problem: sqlite3 * db; rc = sqlite3_open("test.db", &db); if(rc) { fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db)); exit(1); } rc = sqlite3_e

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread drh
Christiane Lemke <[EMAIL PROTECTED]> wrote: > Hello, > > I try to update a row of a Sqlite3 Database with the c++ api using the > following lines of code: > > char dbquery[1024]; > int rc; > sprintf(dbquery, "update zeit_tabelle set zeit = %d where username like > '%s';", 12345, test); > rc = sql

Re: [sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread Jay Sprenkle
On 10/4/05, Christiane Lemke <[EMAIL PROTECTED]> wrote: > > > I try to update a row of a Sqlite3 Database with the c++ api using the > following lines of code: > > char dbquery[1024]; > int rc; > sprintf(dbquery, "update zeit_tabelle set zeit = %d where username like > '%s';", 12345, test); > rc =

[sqlite] SQLITE_CANTOPEN using "update" from c++ api

2005-10-04 Thread Christiane Lemke
Hello, I try to update a row of a Sqlite3 Database with the c++ api using the following lines of code: char dbquery[1024]; int rc; sprintf(dbquery, "update zeit_tabelle set zeit = %d where username like '%s';", 12345, test); rc = sqlite3_exec(db, dbquery, 0, 0, 0); The returned rc is 14, that me