Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite errors #14

Closed
callumbnz opened this issue Sep 16, 2020 · 12 comments
Closed

SQLite errors #14

callumbnz opened this issue Sep 16, 2020 · 12 comments

Comments

@callumbnz
Copy link

[16-Sep-2020 09:46:32 UTC] PHP Warning: SQLite3::query(): Unable to prepare statement: 1, no such column: deg_in in /opt/as-stats/www/func.inc on line 125
[16-Sep-2020 09:46:32 UTC] PHP Fatal error: Uncaught Error: Call to a member function fetchArray() on boolean in /opt/as-stats/www/func.inc:127
Stack trace:
#0 /opt/as-stats/www/index.php(25): getasstats_top(20, '/opt/as-stats/a...', Array)
#1 {main}
thrown in /opt/as-stats/www/func.inc on line 127

Seeing this in my php errors - any ideas?

@rekeds
Copy link

rekeds commented Nov 26, 2020

I'm trying my best to get this also working, git cloned as-stats and as-stats-gui, did all the perl dependencies, and set up nginx.
now I'm kind of able to access the web page, but it gives an error:
The file sqlite3.php could not be found.

I was not able to find info in manuals, readme. will try to search more.

not strong in this web stuff:
using this php fastcgi_pass unix:/run/php/php7.4-fpm.sock;

@nidebr
Copy link
Owner

nidebr commented Nov 26, 2020

Hi, please give me more details.
Nginx & php-fpm log.

module sqlite3 for php is enable ?

@rekeds
Copy link

rekeds commented Dec 2, 2020

Thank you, Nidebr, for the tip, that helped!
apt-get install php7.4-sqlite

now the page is "blank", not giving the above sqlite3.php not found but now in the nginx error.log:

FastCGI sent in stderr: "PHP message: PHP Warning:  SQLite3::query(): Unable to prepare statement: 1, unrecognized token: "2_in" in /var/www/html/as-stats/func.inc on line 125PHP message: PHP Fatal error:  Uncaught Error: Call to a member function fetchArray() on bool in /var/www/html/as-stats/func.inc:127
Stack trace:
#0 /var/www/html/as-stats/index.php(25): getasstats_top()
#1 {main}
  thrown in /var/www/html/as-stats/func.inc on line 127" while reading response header from upstream, client: 10.159.55.22, server: default_server, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "10.253.0.1:81"

@rekeds
Copy link

rekeds commented Dec 2, 2020

for the user above "deg_in", for me its "2_in", I wonder where does the value come from.

@nidebr
Copy link
Owner

nidebr commented Dec 2, 2020

for the user above "deg_in", for me its "2_in", I wonder where does the value come from.

Hi,

Copy/paste here you knownlinks file (from asstats install) plz ?

++

@rekeds
Copy link

rekeds commented Dec 2, 2020

I've used "-" to comment the names, they are short 3-4 character/few CAPS, I've googled and also found something related to knownlinks, but I didn't have "_" underscore in my config, only dash/hypen. an hour before I tried to rename all the xxx-xxx to just xxxxxx. deleted content of /rrd/*
I checked with text-editor that there are no "spaces", replaced them with "tabs", that was before I tried to launch the "app".

usr@stats:/opt/AS-Stats# cat conf/knownlinks
10.101.1.101	329	xxx-xxx	xxx-xxx	A6CEE3	1
10.101.1.101	305	xxx-xxx	xxx-xxx	1F78B4	1
10.102.1.101	578	xxx-xxx-p8	Xxx-X8	A6CEE3	1
10.102.1.101	550	xxx-xx	xxx-x8	FB9A99	1
10.102.1.101	320	xxx-x8-2	xxx-x8-2	E31A1C	1
10.102.1.101	320	xxx-x8	xxx-x8	009966	1

@rekeds
Copy link

rekeds commented Dec 2, 2020

update:
yes, now the error is calling the renamed "xxx-xxx" to just xxxxxx_in

 FastCGI sent in stderr: "PHP message: PHP Warning:  SQLite3::query(): Unable to prepare statement: 1, no such column: xxxxxx_in in /var/www/html/as-stats/func.inc on line 125PHP message: PHP Fatal error:  Uncaught Error: Call to a member function fetchArray() on bool in /var/www/html/as-stats/func.inc:127
Stack trace:
#0 /var/www/html/as-stats/index.php(25): getasstats_top()
#1 {main}
  thrown in /var/www/html/as-stats/func.inc on line 127" while reading response header from upstream, client: 10.159.55.22, server: default_server, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "10.253.0.1:81"

so its related to knownlinks, any tips how to fix or what to read in more detail? Thank you for your time!
What have I missed?

@nidebr
Copy link
Owner

nidebr commented Dec 2, 2020

For me, your problem is on third cols (tag col).
Show me a details on it ?

In ASStats Readme (and knownlink file), tag name :
max. length for tag is 12 characters; allowed characters: a-z A-Z 0-9 _

remove all '-' characters from knowlinks files
remove all your stats files "asstats_day.txt", ect...
remove all files/directory in rrd/*

relaunch asstats, and few minutes after your cron for generate aststats file.

++

@rekeds
Copy link

rekeds commented Dec 2, 2020

thank you!
I already removed "-" before, but was missing clearing the asstats_day..txt and rrd/ again.
now the web-page loads 👍 :)

@nidebr
Copy link
Owner

nidebr commented Dec 2, 2020

Great, have a good day ;)

++

@nidebr nidebr closed this as completed Dec 2, 2020
@nidebr
Copy link
Owner

nidebr commented Dec 2, 2020

Close

@rekeds
Copy link

rekeds commented Dec 2, 2020

a bit more info, if someone else reads this:
the web-gui worked until I executed: ./bin/rrd-extractstats.pl /opt/AS-Stats/rrd /opt/AS-Stats/conf/knownlinks /opt/AS-Stats/asstats/asstats_day.txt

that pointed me back to the knownlinks file (it didn't had hypens, but i didn't know how to check for whitespaces).
I did: awk -v OFS="\t" '$1=$1' conf/knownlinks

another typo I found, I had two equal "interfaces index" for the same "router", fixed that too.

the web-page is loading, graphs are empty. will wait for data, to collect.
thank you very much! be safe :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants