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

[patch] upgrade_database.php fails #63

Closed
paulgevers opened this issue Sep 18, 2016 · 19 comments
Closed

[patch] upgrade_database.php fails #63

paulgevers opened this issue Sep 18, 2016 · 19 comments

Comments

@paulgevers
Copy link
Contributor

The upgrade_database.php script fails for multiple reasons:

  • db_install_execute is defined twice and the update script run from the web page is normally using the one in install/index.php.
  • the update script to 0.8.8h is missing
  • the update script to 1.0.0 is called differently

I am going to try to attach a patch (generated with commit 4ad6ed as base)

@paulgevers
Copy link
Contributor Author

@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

Paul, Please test out of the develop branch. All development is going on there.

@cigamit cigamit closed this as completed Sep 18, 2016
@paulgevers
Copy link
Contributor Author

Hi cigamit,

commit 4ad6ed is 8 days old. Is that already too much for you to consider a patch?

Just for your info, the patch still applies to commit a412be1, which you committed several hours ago.

Paul

@cigamit cigamit reopened this Sep 18, 2016
@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

Oh, Geeze Paul, Yea, I missed this completely. Let me take a second look. Started the day too early I think. You are correct

cigamit

cigamit added a commit that referenced this issue Sep 18, 2016
@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

resolved here 0b452c9

@cigamit cigamit closed this as completed Sep 18, 2016
@paulgevers
Copy link
Contributor Author

cigamit are you sure that you can now run upgrade_database.php stand-alone, i.e. not via http://example.com/cacti/install/ (it is in the script folder for a reason I guess)? I had to get a working version of db_install_execute available to that script.

Why I noticed is that in Debian we run this script during upgrades as discussed in the past.

@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

I simply merged by eye. Let me test it. Will respond shortly.

@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

Confirmed, not working. Looking into it now.

@cigamit cigamit reopened this Sep 18, 2016
@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

Paul,

Give it another shot after you apply d35ca21. Note that after you have things working, we are aware of a few issues, namely that graph export is broken pretty bad. Also, we have disabled magic quotes in this release. The web server should have them disabled as well. We also require the mysql_trime_zone tables to be loaded and the cacti user needs select access to mysql.time_zone_name table.

@cigamit
Copy link
Member

cigamit commented Sep 18, 2016

Another few packaging notes:

We need jQueryUI 1.14. jQuery 1.2 is pretty broken.
We have a custom jquery-multiselect.js,
Our jQueryMigrate has a few minor hacks to disable warnings associated with jQuery 3.1.

There is a another issue with the csrf stuff that needs to be addressed and is still open.

We also need a custom response header in the apache config to handle the font-awesome mime types. We are using a configuration option to add the response header 'Access-Control-Allow-Origin" for the file types tts|otf|svg|eot|woff.

I hope that helps.

cigamit

@paulgevers
Copy link
Contributor Author

Thanks for the heads up on the "interesting" issues.

Debian has jquery-ui version 1.10.1
We will soon have jquery version > 3.0

Is the jquery-multiselect.js really custom, or could it be used in
general the way cacti has it.

Paul

@cigamit
Copy link
Member

cigamit commented Sep 19, 2016

Looks like Eric Hynds has his plugin in github now. We will look at a pull request to merge the functionality.

@cigamit cigamit closed this as completed Sep 19, 2016
@paulgevers
Copy link
Contributor Author

Seems like there is still something missing, although I am suspecting this may very well be related to the Debian setup, i.e. where the cli scripts are not in the same tree as the "site" functions, but one level higher. Nevertheless, I would appreciate any comment.

Upgrading to 1.0.0
PHP Warning: include(../include/global.php): failed to open stream: No such file or directory in /usr/share/cacti/site/install/import_colors.php on line 5
PHP Warning: include(): Failed opening '../include/global.php' for inclusion (include_path='.:/usr/share/php') in /usr/share/cacti/site/install/import_colors.php on line 5
PHP Warning: file(colors.csv): failed to open stream: No such file or directory in /usr/share/cacti/site/install/import_colors.php on line 6
PHP Warning: Invalid argument supplied for foreach() in /usr/share/cacti/site/install/import_colors.php on line 9

@cigamit
Copy link
Member

cigamit commented Sep 20, 2016

Where do you have the install directory located as compared to the include directory. I just tested (translating to debian world)

/usr/share/cacti/site/include
/usr/share/cacti/site/install

How is your setup? It's working fine for me when upgrading from 0.8.8c
[root@myhost cli]# php -q upgrade_database.php -d
Upgrading to 0.8.8d
Upgrading to 0.8.8e
Upgrading to 0.8.8f
Upgrading to 0.8.8g
Upgrading to 0.8.8h
Upgrading to 1.0.0
[root@myhost cli]#

@cigamit cigamit reopened this Sep 20, 2016
@cigamit
Copy link
Member

cigamit commented Sep 20, 2016

Okay, I see the issue now. Resolving momentarily.

@cigamit
Copy link
Member

cigamit commented Sep 20, 2016

Resync. Just tested 'and' verified the cacti.log for backtrace errors. All clean now.

@cigamit cigamit closed this as completed Sep 20, 2016
@paulgevers
Copy link
Contributor Author

Hi cigamit,

On 20-09-16 23:54, cigamit wrote:

Where do you have the install directory located as compared to the
include directory. I just tested (translating to debian world)

/usr/share/cacti/site/include
/usr/share/cacti/site/install

How is your setup?

The upgrade script is in
/usr/share/cacti/cli # note that it is outside the site directory.

It's working fine for me when upgrading from 0.8.8c

I still got:
Upgrading to 1.0.0
PHP Warning: include(../include/global.php): failed to open stream: No
such file or directory in
/usr/share/cacti/site/install/import_colors.php on line 5
PHP Warning: include(): Failed opening '../include/global.php' for
inclusion (include_path='.:/usr/share/php') in
/usr/share/cacti/site/install/import_colors.php on line 5
PHP Notice: Undefined variable: config in
/usr/share/cacti/site/install/import_colors.php on line 6
PHP Warning: file(/install/colors.csv): failed to open stream: No such
file or directory in /usr/share/cacti/site/install/import_colors.php on
line 6
PHP Warning: Invalid argument supplied for foreach() in
/usr/share/cacti/site/install/import_colors.php on line 9

I was able to fix that by using the attached patch.

Paul

@paulgevers
Copy link
Contributor Author

Index: cacti/install/import_colors.php
===================================================================
--- cacti.orig/install/import_colors.php
+++ cacti/install/import_colors.php
@@ -2,7 +2,7 @@

 $no_http_headers = true;

-include('../include/global.php');
+include(dirname(__FILE__) . '/../include/global.php');
 $contents = file($config['base_path'] . '/install/colors.csv');

 if (sizeof($contents)) {

@cigamit
Copy link
Member

cigamit commented Sep 21, 2016

okay, all set now. give some of the new themes a test drive. my favorite is 'Dark', though not finished 'Paw' looks pretty good too.

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

No branches or pull requests

2 participants