Sqlite error code 14 when using 3.31.0+

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Sqlite error code 14 when using 3.31.0+

Daniel Polski
Updated to 3.31.1 but my application started spitting out an error when
opening the database, so I tested some earlier sqlite versions to figure
out when the problem starts.
I don't get the message in versions <= 3.30.1.

(from the applications log)
SQLite Version: 3.31.0
INFO: Database opened: /tmp/database.sqlite
WARNING: SQLITE error code: 14 cannot open file at line 36982 of
[3bfa9cc97d]
WARNING: SQLITE error code: 14 os_unix.c:36982: (40) openDirectory(/tmp) -

It seems related to opening the WAL file. Anything I should change when
using sqlite >= 3.31.0 ?

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite error code 14 when using 3.31.0+

Rowan Worth-2
On Mon, 9 Mar 2020 at 23:22, Daniel Polski <[hidden email]> wrote:

> Updated to 3.31.1 but my application started spitting out an error when
> opening the database, so I tested some earlier sqlite versions to figure
> out when the problem starts.
> I don't get the message in versions <= 3.30.1.
>
> (from the applications log)
> SQLite Version: 3.31.0
> INFO: Database opened: /tmp/database.sqlite
> WARNING: SQLITE error code: 14 cannot open file at line 36982 of
> [3bfa9cc97d]
> WARNING: SQLITE error code: 14 os_unix.c:36982: (40) openDirectory(/tmp) -
>

errno 40 is ELOOP, "Too many symbolic links encountered". open(2) says:

       ELOOP  Too many symbolic links were encountered in resolving
 pathname,  or  O_NOFOLLOW  was
              specified but pathname was a symbolic link.

Is your /tmp/ a symlink? Sqlite seems to use O_NOFOLLOW unconditionally in
openDirectory() since this checkin:

https://www.sqlite.org/src/info/6a64fb6a2da6c98f

Probably a bug? The changelog for sqlite 3.31.0 include this which is
likely related:

- * Add the SQLITE_OPEN_NOFOLLOW
<https://www.sqlite.org/c3ref/open.html#opennofollow> option to
sqlite3_open_v2() <https://www.sqlite.org/c3ref/open.html> that prevents
SQLite from opening symbolic links.

-Rowan
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite error code 14 when using 3.31.0+

Graham Holden
Tuesday, March 10, 2020, 1:33:13 AM, Rowan Worth <[hidden email]> wrote:

> On Mon, 9 Mar 2020 at 23:22, Daniel Polski <[hidden email]> wrote:

>> Updated to 3.31.1 but my application started spitting out an error when
>> opening the database, so I tested some earlier sqlite versions to figure
>> out when the problem starts.
>> I don't get the message in versions <= 3.30.1.
>>
>> (from the applications log)
>> SQLite Version: 3.31.0
>> INFO: Database opened: /tmp/database.sqlite
>> WARNING: SQLITE error code: 14 cannot open file at line 36982 of
>> [3bfa9cc97d]
>> WARNING: SQLITE error code: 14 os_unix.c:36982: (40) openDirectory(/tmp) -
>>

> errno 40 is ELOOP, "Too many symbolic links encountered". open(2) says:

>        ELOOP  Too many symbolic links were encountered in resolving
>  pathname,  or  O_NOFOLLOW  was
>               specified but pathname was a symbolic link.

> Is your /tmp/ a symlink? Sqlite seems to use O_NOFOLLOW unconditionally in
> openDirectory() since this checkin:

> https://www.sqlite.org/src/info/6a64fb6a2da6c98f

> Probably a bug? The changelog for sqlite 3.31.0 include this which is
> likely related:

> - * Add the SQLITE_OPEN_NOFOLLOW
> <https://www.sqlite.org/c3ref/open.html#opennofollow> option to
> sqlite3_open_v2() <https://www.sqlite.org/c3ref/open.html> that prevents
> SQLite from opening symbolic links.

Assuming /tmp IS a symlink, then since it's the parent directory of
the SQLite file that openDirectory fails on, I would hazard a wild
guess that this has something to do with SQLite's handling of journal
files, about which that above check-in comment notes "O_NOFOLLOW is
always included in open() system calls for journal files".

Graham Holden

(There were an earlier pair of emails to the list on 13th Feb this
year where use of O_NOFOLLOW was triggering ELOOP, but I suspect that
wasn't directly related as the problem there was "protection" code in
SQLite that was opening /dev/null was failing because /dev/null under
Solaris was itself a symbolic link (see
https://www.sqlite.org/src/timeline?c=0c683c43a62fe25c)


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite error code 14 when using 3.31.0+

Daniel Polski
In reply to this post by Rowan Worth-2
Den 2020-03-10 kl. 02:33, skrev Rowan Worth:

> On Mon, 9 Mar 2020 at 23:22, Daniel Polski <[hidden email]> wrote:
>
>> Updated to 3.31.1 but my application started spitting out an error when
>> opening the database, so I tested some earlier sqlite versions to figure
>> out when the problem starts.
>> I don't get the message in versions <= 3.30.1.
>>
>> (from the applications log)
>> SQLite Version: 3.31.0
>> INFO: Database opened: /tmp/database.sqlite
>> WARNING: SQLITE error code: 14 cannot open file at line 36982 of
>> [3bfa9cc97d]
>> WARNING: SQLITE error code: 14 os_unix.c:36982: (40) openDirectory(/tmp) -
>>
> errno 40 is ELOOP, "Too many symbolic links encountered". open(2) says:
>
>         ELOOP  Too many symbolic links were encountered in resolving
>   pathname,  or  O_NOFOLLOW  was
>                specified but pathname was a symbolic link.
>
> Is your /tmp/ a symlink? Sqlite seems to use O_NOFOLLOW unconditionally in
> openDirectory() since this checkin:
>
> https://www.sqlite.org/src/info/6a64fb6a2da6c98f

/tmp/ is a directly mounted ramdisk.

> Probably a bug? The changelog for sqlite 3.31.0 include this which is
> likely related:
>
> - * Add the SQLITE_OPEN_NOFOLLOW
> <https://www.sqlite.org/c3ref/open.html#opennofollow> option to
> sqlite3_open_v2() <https://www.sqlite.org/c3ref/open.html> that prevents
> SQLite from opening symbolic links.
>
Ok.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite error code 14 when using 3.31.0+

Daniel Polski

Den 2020-03-10 kl. 12:31, skrev Daniel Polski:

> Den 2020-03-10 kl. 02:33, skrev Rowan Worth:
>> On Mon, 9 Mar 2020 at 23:22, Daniel Polski <[hidden email]>
>> wrote:
>>
>>> Updated to 3.31.1 but my application started spitting out an error when
>>> opening the database, so I tested some earlier sqlite versions to
>>> figure
>>> out when the problem starts.
>>> I don't get the message in versions <= 3.30.1.
>>>
>>> (from the applications log)
>>> SQLite Version: 3.31.0
>>> INFO: Database opened: /tmp/database.sqlite
>>> WARNING: SQLITE error code: 14 cannot open file at line 36982 of
>>> [3bfa9cc97d]
>>> WARNING: SQLITE error code: 14 os_unix.c:36982: (40)
>>> openDirectory(/tmp) -
>>>
>> errno 40 is ELOOP, "Too many symbolic links encountered". open(2) says:
>>
>>         ELOOP  Too many symbolic links were encountered in resolving
>>   pathname,  or  O_NOFOLLOW  was
>>                specified but pathname was a symbolic link.
>>
>> Is your /tmp/ a symlink? Sqlite seems to use O_NOFOLLOW
>> unconditionally in
>> openDirectory() since this checkin:
>>
>> https://www.sqlite.org/src/info/6a64fb6a2da6c98f
>
> /tmp/ is a directly mounted ramdisk.


Sorry I was wrong.

/tmp/ actually IS a symlink to /var/volatile/tmp

Best regards,


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users