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

Automatic Configuration fails when installing on Debian 8.2 Virtual Server #44

Closed
AnonymusChaotic opened this issue Dec 31, 2015 · 20 comments

Comments

@AnonymusChaotic
Copy link

Hello!
(Attention, the Problem occured 2Weeks ago. I had posted it to http://forum.piwik.org/t/bug-debian-install-missing-config-ini-php-not-found-apache-and-database-error/17291 at first.)
When Installing Piwik on Debian Server (minimal, 8.2) there were several mistakes in automatic configuration:
I wass following the installation instructions at http://debian.piwik.org/
here a piece of my log immediately after selecting that I want to enable automatic database upgrade:

`Lighttpd not installed, skipping
APACHE IS INSTALLED

Apache2 not installed, skipping

  • Piwik main configuration files are stored in /etc/piwik/
  • Piwik crontab file is stored in /etc/cron.d/piwik-archive
  • When installing/using piwik, make sure you disable any ads blocker
  • Please wait while Piwik is upgrading...
    THE CONFIGURATION FILE IS MISSING

The configuration file {/usr/share/piwik/config/config.ini.php} has not been found or could not be read.
If the file exists, please check that /usr/share/piwik/config/config.ini.php is readable by the user 'root'.

#####THIS AREA IS RED #####

[Zend_Db_Adapter_Exception]
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

END RED
THIS AREA IS RED

[PDOException]
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

END RED

gREEN:
core:update [--yes]

dpkg: Fehler beim Bearbeiten des Paketes piwik (--configure):
Unterprozess installiertes post-installation-Skript gab den Fehlerwert 255 zurück
Fehler traten auf beim Bearbeiten von:
piwik
E: Sub-process /usr/bin/dpkg returned an error code (1)
`
So at first piwik couldnt find apache2, although it is installed, then a configuration file was missing, but this should be created during installation and at least there was a database error.
Maybe there should be added something like it is when installing PHPMYADMIN, there it asks all the necessary things like Webserver to be used (I use Apache), password of the database, ...
Of course piwik cant access my database without using a password.

The problem with the missing config.ini.php could be solved by copying the global.ini.php. But I don't know if it is correct

A Few Days later I had a big Problem with all my PHP - Mysql programs but I don't know if its the fault of Piwik.

Yours,
Harald

@frague59
Copy link

frague59 commented Feb 5, 2016

+1

1 similar comment
@pyrignis
Copy link

+1

@aureq
Copy link
Contributor

aureq commented Feb 27, 2016

@AnonymusChaotic it looks like /usr/share/piwik/config/config.ini.php is missing. As far as I know, /usr/share/piwik/config/ should be a link to /etc/piwik and config.ini.php should be in there.
The installation will inevitably fail as long as you haven't run the web installation wizard that will create that configuration file for you.

@MrPetovan
Copy link

+1 on a dedicated server running Debian Squeezy 8.4, Apache 2.4.10 with a MySQL server with a password-protected root account. Ended up installing manually.

@peteramckay
Copy link

peteramckay commented Jun 19, 2016

+1. My server is running Ubuntu 14.04 and Nginx 1.11.1 with a MySQL server w/ password-protected root account.

@sveeke
Copy link

sveeke commented Jun 26, 2016

+1, won't install on Debian 8 Jessie with Apache2 and MariaDB-server (obviously password protected root account).

Creating config file /etc/php5/mods-available/curl.ini with new version
php5_invoke: Enable module curl for apache2 SAPI
php5_invoke: Enable module curl for cli SAPI
Setting up piwik (2.16.1-1) ...
Lighttpd not installed, skipping
Apache2 not installed, skipping
  * Piwik main configuration files are stored in /etc/piwik/
  * Piwik crontab file is stored in /etc/cron.d/piwik-archive
  * When installing/using piwik, make sure you disable any ads blocker
  * Please wait while Piwik is upgrading...
The configuration file {/usr/share/piwik/config/config.ini.php} has not been found or could not be read.
If the file exists, please check that /usr/share/piwik/config/config.ini.php is readable by the user 'root'.

  [Zend_Db_Adapter_Exception]
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

  [PDOException]
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

core:update [--yes]

dpkg: error processing package piwik (--configure):
 subprocess installed post-installation script returned error exit status 255
Setting up php5-geoip (1.1.0-2) ...
Processing triggers for libapache2-mod-php5 (5.6.22+dfsg-0+deb8u1) ...
Errors were encountered while processing:
 piwik
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@[deleted]:~# apt-get install piwik
Reading package lists... Done
Building dependency tree
Reading state information... Done
piwik is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up piwik (2.16.1-1) ...
Lighttpd not installed, skipping
Apache2 not installed, skipping
  * Piwik main configuration files are stored in /etc/piwik/
  * Piwik crontab file is stored in /etc/cron.d/piwik-archive
  * When installing/using piwik, make sure you disable any ads blocker
  * Please wait while Piwik is upgrading...
The configuration file {/usr/share/piwik/config/config.ini.php} has not been found or could not be read.
If the file exists, please check that /usr/share/piwik/config/config.ini.php is readable by the user 'root'.

  [Zend_Db_Adapter_Exception]
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

  [PDOException]
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

core:update [--yes]

dpkg: error processing package piwik (--configure):
 subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
 piwik
E: Sub-process /usr/bin/dpkg returned an error code (1)

@welcomee
Copy link

+1

@openbrian
Copy link

I get this error too.

@openbrian
Copy link

I'm not 100% sure, but I think Piwik is expecting a passwordless root account in MySQL. After clearing the password, the website installation wizard appeared and I walked through about 6 steps to complete the install. I had also removed the config.ini.php file before doing that.

@AsbjornOlling
Copy link

+1 - same error on Debian Jessie 8.8
There is no config.ini.php in either /usr/share/piwik/config/ or /etc/piwik...

$ sudo apt install piwik

Reading package lists... Done
Building dependency tree       
Reading state information... Done
piwik is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up piwik (3.0.4-1) ...
Lighttpd not installed, skipping
Apache2 not installed, skipping
  * Piwik main configuration files are stored in /etc/piwik/
  * Piwik crontab file is stored in /etc/cron.d/piwik-archive
  * When installing/using piwik, make sure you disable any ads blocker
  * Please wait while Piwik is upgrading...

The configuration file {/usr/share/piwik/config/config.ini.php} has not been found or could not be read.
 » Please check that /usr/share/piwik/config/config.ini.php is readable by the user 'root'. 
                                                                                         
  [Zend_Db_Adapter_Exception]                                                            
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)  
                                                                                        
  [PDOException]                                                                         
  SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

core:update [--yes]
dpkg: error processing package piwik (--configure):
 subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
 piwik
E: Sub-process /usr/bin/dpkg returned an error code (1)

@iigorkarpov
Copy link

Same for Debian 9.1

Two years old bug. And no one seems really interested... I suppose the package is hopelessly broken.

@aureq
Copy link
Contributor

aureq commented Sep 15, 2017

So, this issue is in 2 parts:

1 - Piwik open-source doesn't support full automated install. If you have such a need, then it's best to contact InnoCraft who should be able to help you. https://www.innocraft.cloud/

2 - Regarding some of the error message, I published a fixed which is going to be pushed in the next hour with piwik 3.1.0 If config.ini.php is not found then the error shouldn't appear.

As a side note, if a bug is bugging you then you have 2 options. You could sponsor (bitcoin is great for that) the open-source community to prioritize the bug or propose a patch if you feel like doing a bit of hacking (in the open-source spirit of the word)

@iigorkarpov
Copy link

To be honest, I don't mind. If people love to keep their product, no matter paid or free, in a bad state, who I am to interfere? It's their product, their choice.

@aureq
Copy link
Contributor

aureq commented Sep 15, 2017

I understand @iigorkarpov but the comment was directed to people willing to help and contribute in the community.

Closing this bug since the debian/ubuntu package 3.1.0-3 should be addressing the issue along with a potential race condition.

@aureq aureq closed this as completed Sep 15, 2017
@dg01d
Copy link
Contributor

dg01d commented Oct 13, 2017

No, this issue should not have been closed. Clean Debian jessie 8.8, installing from the repo:-

Setting up piwik (3.1.1-1) ...
Lighttpd not installed, skipping
Apache2 not installed, skipping

  • Piwik main configuration files are stored in /etc/piwik/
  • Piwik crontab file is stored in /etc/cron.d/piwik-archive
  • When installing/using piwik, make sure you disable any ads blocker
  • Automatic upgrade not perform as Piwik doesn't seem to be installed.
  • Have you configured it yet?

@aureq
Copy link
Contributor

aureq commented Oct 13, 2017

Hi @dg01d

From the look of it, the post installation script tells you that neither apache2 nor lighttpd are installed. Also, the database upgrade isn't being performed because Piwik installation wizard (run from the web interface) hasn't been done yet (You mentioned it's a clean install).

On the first item, it's up to you to install a web server. If you are using something different than apache2 or lighttpd, the package installation should complete just fine, except that the package will not be able to provide any default web configuration for you chosen web server. But your pull request is welcome.

On the second item, the full automated installation that creates the database and Piwik configuration file (/etc/piwik/config.ini.php) is not supported by this package as it's a professional feature that's provided by Innocraft. If this is a requirement to your or your business, I would highly recommend that you purchase their services as they are extremely competent.

Peace and Love

@dg01d
Copy link
Contributor

dg01d commented Oct 14, 2017

Apache2 is installed and running, that's not the issue.

The issue is that the installation script has hardcoded the location /etc/apache2/conf.d for the necessary conf file, whereas a modern apache2 installation places this file in /etc/apache2/conf-available with a symlink from /e/a/conf-enabled

@aureq
Copy link
Contributor

aureq commented Oct 14, 2017

@dg01d Thank you for providing the details.

I believe the conf.d is Debian old way (Debian 7), where conf-available is a more recent way (Debian 8 and above). Could you please propose a patch that would handle both paths? I'll be happy to review your pull request. Please open a new issue so it's easier to track.

Thank you.

@dg01d
Copy link
Contributor

dg01d commented Oct 14, 2017

PR submitted

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

13 participants