3 posts / 0 new
Last post
jdanders
Self-Hosted server error: 'owner' cannot be null

Hi, I've got two questions. The first is the topic of the thread:

I've installed the server on my Ubuntu server following the instructions here: https://docs.openvehicles.com/en/latest/server/installation.html

I believe I did everything indicated in the guide, but something is not working correctly. Originally there were drupal errors in the logs, so I disabled the drupal plugin (recommended in the guide, but there's no help on how to install it or make it work). Currently, I have these recurring errors:

Use of uninitialized value $name in hash element at plugins/system/OVMS/Server/DbDBI.pm line 154.
DBD::mysql::db do failed: Column 'owner' cannot be null at plugins/system/OVMS/Server/DbDBI.pm line 385.

I looked in the database and found a couple of places where owner seemed expected. My DB currently has these entries:

mysql> select * from ovms_cars;
+-----------+-------------+-------+-----------+---------------+-----------+-------------+----------+----------+--------+---------+---------------------+---------------------+------------+
| vehicleid | vehiclename | owner | telephone | carpass       | userpass  | cryptscheme | v_ptoken | v_server | v_type | deleted | changed             | v_lastupdate        | couponcode |
+-----------+-------------+-------+-----------+---------------+-----------+-------------+----------+----------+--------+---------+---------------------+---------------------+------------+
| Sticky    | Sticky      |     1 |           | **mypassword* | **pass** | 0           |          | *        | CAR    |       0 | 1900-01-01 00:00:00 | 1900-01-01 00:00:00 |            |
+-----------+-------------+-------+-----------+---------------+-----------+-------------+----------+----------+--------+---------+---------------------+---------------------+------------+

mysql> select * from ovms_owners;
+-------+--------+-----------------+-----------+--------+---------+---------------------+
| owner | name   | mail            | pass      | status | deleted | changed             |
+-------+--------+-----------------+-----------+--------+---------+---------------------+
|     1 | jdande | j****@gmail.com | **pass**  |      0 |       0 | 0000-00-00 00:00:00 |
+-------+--------+-----------------+-----------+--------+---------+---------------------+

mysql> select * from ovms_apitokens;
+-------+---------------------+-------------+---------+--------+---------------------+---------------------+---------------------+
| owner | token               | application | purpose | permit | created             | refreshed           | lastused            |
+-------+---------------------+-------------+---------+--------+---------------------+---------------------+---------------------+
|     1 | **token_from_app**  | app         | control | none   | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |
+-------+---------------------+-------------+---------+--------+---------------------+---------------------+---------------------+

Is there some other entry I need to make to fix these "can't find owner" errors? What is the correct way to get started with self-hosted server?

There's a chance that this is not the root cause of my issue. I can see the module and app communicate with the server, but the app shows no data and I don't think the server is recording anything.

 

2nd question:

Why is self-hosted server a second-class consideration? I'm excited about this project to keep my data private, but the default is to use a public server. When I found OVMS, I was surprised there wasn't a Docker image ready to go to self-host. Is there something I'm missing in my concerns about user privacy and vehicle control and using a public server?

(I'm referring to this comment in the install guide when I say second-class and default:

"You should, however, start by asking yourself the question ‘do I need this?’."

And based on my experience the instructions aren't complete, and therefore probably aren't used very often.)

 

Thanks in advance!

 

markwj
markwj's picture
Use of uninitialized value
Use of uninitialized value $name in hash element at plugins/system/OVMS/Server/DbDBI.pm line 154.
DBD::mysql::db do failed: Column 'owner' cannot be null at plugins/system/OVMS/Server/DbDBI.pm line 385.

Can you show the log lines that preceded these error messages? The error says that the owner name is not being provided to DBOwnerIDByName, but that doesn't make much sense.

Originally there were drupal errors in the logs,

How have you implemented the authentication? You will require a custom plugin for that, if not using Drupal. See here:

https://www.openvehicles.com/comment/8417

Why is self-hosted server a second-class consideration?

I guess because 99.9% of users won't have the need for it. Such as when you want to send/receive eMail you could setup your own SMTP email server, IMAP/POP3 mailbox daemon, webmail add-on, anti-malware and anti-spam scanning services, etc. Or you could just sign up for gmail. Almost all individuals choose the latter.

The other issue is that PUSH notifications to the Apps can't easily be raised from self-hosted servers (due to security limitations from the Apple and Google platforms).

Longer-term, I believe that MQTT is the way forward rather than our own proprietary server (which was required 10 years ago with 2G data throughput, but is not the case today). Migrating the apps and modules to that standard (once we have MQTT 5 protocol support) is the better approach, can use any of several open source MQTT servers, and integrates nicely with IoT and home automation.

IamMattM
Has the Docker approach been considered for the MQTT server v3?

Just like @jdanders said, I was also surprised that the Docker container for self-hosted servers, v2 or v3, had not been made available through DockerHub already.

Is it something resonably easy to do for a developer ?





 

Log in or register to post comments