arnovr/ocusagecharts

After opening Usage Chart DB error?

Closed this issue · 4 comments

Hi after opening the chart vieuw I get this error:

An exception occurred while executing 'SELECT * FROM oc_uc_chartconfig WHERE username = ?' with params ["admin"]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_uc_chartconfig' doesn't exist

I'm not sure if it's a bug, just really want to know how to fix it.

Thankyou:)!

Hello heinkentap ( sounds dutch, like i am :) ),

When installing the application through the admin interface, owncloud should render database.xml and add the tables to the owncloud database.
Apparently this did not happen... I do not know enough about owncloud to know why this situation could occur, but i will look into it.

As for your fix, you are probably missing both(oc_uc_chartconfig,oc_uc_storageusage) required tables, the app is delivered with appinfo/tables.sql which holds the sql required by this app.
Add them to your database, and it should be fixed.

Both create statements for the tables required:

CREATE TABLE oc_uc_storageusage (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    created DATETIME NOT NULL,
    username VARCHAR(255) NOT NULL,
    `usage` INT NOT NULL
);
CREATE TABLE oc_uc_chartconfig (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    created TIMESTAMP NOT NULL,
    username VARCHAR(255) NOT NULL,
    charttype VARCHAR(255) NOT NULL,
    chartprovider VARCHAR(255) NOT NULL DEFAULT 'c3js'
);

If you need some extra help, let me know.

Hi Arnovr!

I'm dutch, good guess :)

But for other peeps out there with the same problem i'll continue my story in English.

After running your queries in phpMyAdmin I managed to solve the error:) So many thanks for that!
Now an other problem has appeared, the showChart/1 (current data usage) says that I have 100% free capacity:/ Also the other carts are empty..

Maybe you're able to help

Thanks!

One of the requirements is:
"Cronjobs must run every day!"

The cronjobs fill up the data everyday, probably nothing is filled yet.
Let me know if the cronjob will fix the issue.

It works! 👍
Thanks