Fatal error: Uncaught exception 'Exception' with message 'disk I/O error'

Hi dear community,

I´m trying to set WAL mode to my sqlite3 db from PHP%:

PHP code:

$this->_db->query('PRAGMA journal_mode = WAL');

I´m getting the following error:
Fatal error: Uncaught exception 'Exception' with message 'disk I/O error' in /www/reader.php:28

Any idea to solve this? I thought it was because of my sqlite3 version, I have upgraded to 3.26.0. Also it can be something related with the Virtual File System, however I dont know how to troubleshoot this problem.

Thanks in advance.

Letting the people here know what version of OpenWrt you are running, as well as the related packages would help a bit. Also, "Virtual File System" is a term that at least I'm not familiar with in the context of OpenWrt.

('PRAGMA journal_mode = wal;');
1 Like

OpenWrt version: (17.01.4, r3560-79f57e422d)
This is what I'm getting from the lsblk command about the current block devices:

mtdblock5 is the one that I'm trying to understand what is its the file system and how I can change it.

(Posting using the preformatted-text button </> is much more usable than screen shots)

/overlay is the r/w portion of the file system. It can be seen more clearly with mount. Here, from an Archer C7v2

$ mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup on /sys/fs/cgroup type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,pids)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock4 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

One general reference on overlay file systems is https://wiki.archlinux.org/index.php/Overlay_filesystem

In brief, when looking for a file for read, the overlay is checked first. If the file exists, then it is used. If not, then the underlying file system is checked and used, if present. For write, the write is to the top-most overlay (multiples are possible). For delete, the top-most overlay gets a special mark, "Wite-Out" in a way, that indicates that the file, even if present on lower layers, "does not exist".