NextPVR Forums

Full Version: No device listed -- error saving capture source: SQLite Error 1: 'no such column: −1'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Excuse my ignorance of this subject -- it's the first time I touch pvr software and tv cards.

On my first try I installed nextpvr using the recommended .deb method, including install-recommends, on Ubuntu 23.10. It starts up fine but then shows no devices in the settings web ui.

In the log I can then read that it finds the device but cannot save it to the database:

Code:
2024-04-11 16:19:49.802    [DEBUG][1]    Local Devices: <devices>
  <device>
    <name>adapter0/frontend0 (E3C EC100 DVB-T)</name>
    <type>DVB-T</type>
    <filter>adapter0/frontend0</filter>
    <instance>1</instance>
    <resource>adapter0</resource>
  </device>
  <device>
    <name>adapter0/frontend0 (E3C EC100 DVB-T)</name>
    <type>DVB-C</type>
    <filter>adapter0/frontend0</filter>
    <instance>1</instance>
    <resource>adapter0</resource>
  </device>
</devices>

2024-04-11 16:19:49.804    [DEBUG][1]    adapter0/frontend0
2024-04-11 16:19:49.804    [DEBUG][1]    adapter0/frontend0
2024-04-11 16:19:49.806    [ERROR][1]    Unexpected error saving capture source: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: −1'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at NShared.Visible.CaptureSource.Save()
2024-04-11 16:19:49.806    [DEBUG][1]    Added new device 'adapter0/frontend0 (E3C EC100 DVB-T)'
2024-04-11 16:19:49.807    [ERROR][1]    Unexpected error saving capture source: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: −1'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at NShared.Visible.CaptureSource.Save()
2024-04-11 16:19:49.807    [DEBUG][1]    Added new device 'adapter0/frontend0 (E3C EC100 DVB-T)'

If the UI is data-driven (and why shouldn't it be) then that would explain it. To me it looks like it's trying to access a column with name "-1" (or is that just the returned status code?), and that in turn looks like an error output of some command, but I don't know.

This was just an experiment to see how easy it would be to get up and running with a random usb tv card. So far no luck, other than that the OS detects it, loads the correct driver, and that I can record from it manually and successfully using cli tools. 

Am I missing a component? I've run the install command multiple times and at no point does it complain that anything has failed to install.
I would suggest stopping the recording service, removing /var/opt/nextpvr/npvr.db3 and then restarting the service. Before removing it I would be interested in seeing what ls -la /var/opt/nextpvr/npvr.db3 shows.

There might be a secondary problem that the service doesn't have access to IP other than localhost but one problem at a time.

Martin
Thanks for taking a look!


Code:
$ ls -la /var/opt/nextpvr/npvr.db3
-rw-r--r-- 1 nextpvr nextpvr 41984 apr 11 16:34 /var/opt/nextpvr/npvr.db3

At least the date is today, and not the same date as the first time I installed and ran nextpvr.



I'm assuming that "nextpvr-server" is the "recording service" -- I don't know of other nextpvr services.

Same result after stopping service, db deletion and starting the service again, as far as I can see.

I gave the machine an IP and internet access during the procedure (not that I can see any need for it).
Could you zip up and send /var/opt/nextpvr/npvr.db3 please? The logs show it copying but the source is different

-rw-r--r-- 1 root root 31744 Dec 29 2019 /opt/nextpvr/system/data/empty.db3

and I'd like to see what is happening to the database.

An IP is needed for discovery of network tunres and of course for playback on external clients.

Martin
Here's the db
Seems ok, are you running in a VM or a memory constrained environment?

Martin
No, bare metal. 8 GB memory, using less than half. A test laptop under no load.

Did the db seem ok as in "a column called '-1' exists"? Or as in "the device is present in the db"?

What was the suspected problem, based on the logged error messages? I'm not sure I interpreted them correctly.
I don't see it related to the tuner, the database cannot get updated, diskspace for /var/opt/nextpvr or memory came to mind. Testing here I disconnect from the LAN and it still works with the database you sent, so I don't think it is SAT>IP or HDHR IPs getting in the way.

The message is always "Unexpected error saving capture source" and it can't even save the IPTV tuner.

If you unplug the tuner completely and restart nextpvr-server do you see an IPTV device?

Martin
Now, I obviously haven't looked at the code and am not familiar with it, but just to be sure, the "SQLite Error 1: 'no such column: −1'", doesn't it mean that it's trying to access a column named "-1"? Isn't that the problem? Why should we look further than that for the cause?

Where does the "-1" come from, and isn't it possible that it's just the value of a variable that isn't being properly quoted in an SQL query and being interpreted as a column name (e.g. https://stackoverflow.com/a/6337345)? If you know the file/line where this happens maybe we could take a look.

As for your question: I'm not familiar with IPTV sources, but from what you've said I'm guessing that it's a virtual device that's supposed to show up in Settings > Devices? No devices show up when the hardware tuner has bee disconnected. Just the page header with the "Scan for devices" button...
First only sub can look at the source and of course the error show the problem with the table but don't trust the -1 I strongly suspect the -1 is a return code not a column name. I suspect it is how you locked down your install but I can only base that on your comment that you gave it and IP and internet access.

NextPVR installation will start by having an IPTV device added when they start up. This is the first time for this error in 4 years of Linux use so it is a bit hard to troubleshoot. If you can do these command in sqlite3 when can see if there is a system issue.

Code:
sudo service nextpvr-server stop
sudo -u nextpvr sqlite3 /var/opt/nextpvr/npvr.db3

insert into capture_source ('name', 'recorder_plugin_class', 'present', 'enabled', 'priority') values('IPTV Device', 'NShared.IPTVRecorder', 'Y', 'Y', 0);
insert into IPTV_RECORDER(capture_source_oid,max_connections) select oid, '32' from capture_source limit 1;
.exit
sudo service nextpvr-server start


Martin
Pages: 1 2 3 4 5