Errors updating Roundcube

Richard G

Verified User
Joined
Jul 6, 2008
Messages
12,560
Location
Maastricht
On 1 of our servers, the newest with MariaDB and Centos 7, we got a lot of errors when updating Roundcube:
Code:
[root@server22: /usr/local/directadmin/custombuild]# ./build roundcube
[b]/usr/bin/mysqlshow: unknown variable 'local-infile=0'[/b]
Inserting data to mysql and creating database/user for roundcube...
ERROR 1007 (HY000) at line 1: Can't create database 'da_roundcube'; database exists
ERROR 1050 (42S01) at line 8 in file: 'SQL/mysql.initial.sql': Table 'session' already exists
ERROR 1050 (42S01) at line 20 in file: 'SQL/mysql.initial.sql': Table 'users' already exists
ERROR 1050 (42S01) at line 37 in file: 'SQL/mysql.initial.sql': Table 'cache' already exists
ERROR 1050 (42S01) at line 51 in file: 'SQL/mysql.initial.sql': Table 'cache_shared' already exists
ERROR 1050 (42S01) at line 62 in file: 'SQL/mysql.initial.sql': Table 'cache_index' already exists
ERROR 1050 (42S01) at line 77 in file: 'SQL/mysql.initial.sql': Table 'cache_thread' already exists
ERROR 1050 (42S01) at line 91 in file: 'SQL/mysql.initial.sql': Table 'cache_messages' already exists
ERROR 1050 (42S01) at line 107 in file: 'SQL/mysql.initial.sql': Table 'contacts' already exists
ERROR 1050 (42S01) at line 126 in file: 'SQL/mysql.initial.sql': Table 'contactgroups' already exists
ERROR 1050 (42S01) at line 138 in file: 'SQL/mysql.initial.sql': Table 'contactgroupmembers' already exists
ERROR 1050 (42S01) at line 153 in file: 'SQL/mysql.initial.sql': Table 'identities' already exists
ERROR 1050 (42S01) at line 176 in file: 'SQL/mysql.initial.sql': Table 'dictionary' already exists
ERROR 1050 (42S01) at line 189 in file: 'SQL/mysql.initial.sql': Table 'searches' already exists
ERROR 1050 (42S01) at line 204 in file: 'SQL/mysql.initial.sql': Table 'system' already exists
ERROR 1062 (23000) at line 212 in file: 'SQL/mysql.initial.sql': Duplicate entry 'roundcube-version' for key 'PRIMARY'
Database created, da_roundcube password is xxxxxxxxxxxxkx
Editing roundcube configuration...
Installing custom RoundCube Config: /usr/local/directadmin/custombuild/custom/roundcube/config.inc.php
[b]grep: /var/www/html/roundcubemail-1.3.7/.htaccess: No such file or directory[/b]
Roundcube 1.3.7 has been installed successfully.
Executing database schema update.
Indexing contacts for user 1...
Indexing contacts for user 2...
Indexing contacts for user 3...
Indexing contacts for user 4...
Indexing contacts for user 5...
Indexing contacts for user 6...
Indexing contacts for user 7...
Indexing contacts for user 8...
done.
This instance of Roundcube is up-to-date.
Have fun!

I did had a custom config.inc.php for roundcube, but removed it and still have these errors.
Next to that, where is that .htaccess error coming from? I don't have a .htaccess in that location in any of our servers, however, the other (Centos 6.10) servers don't give errors about it.

Also I have:
local-infile=0
i the [mysqld] section of /etc/my.cnf.d/server.cnf which I thought was good. But it's giving this error notice here. Even if I put it in my.cnf where I had it when not using Mariadb but just plain mysql.

How can I fix these errors?
 
Regarding local-infile=0 - it must be under [mysqld] section of my.cnf.

Regarding the .htaccess... I really don't know. I will give you the code of the file so you can probably create it manually and rebuild:

Code:
# WARNING: For PHP 7 the module name in the line below need to be modified!
<IfModule mod_php7.c>
php_flag    display_errors  Off
php_flag    log_errors      On
# php_value    error_log    logs/errors

#php_value   upload_max_filesize   5M
#php_value   post_max_size         6M
#php_value   memory_limit          64M

php_flag    zlib.output_compression     Off
php_flag    suhosin.session.encrypt     Off

#php_value   session.cookie_path     /
#php_value   session.hash_function   sha256
php_flag    session.auto_start       Off
php_value   session.gc_maxlifetime   21600
php_value   session.gc_divisor       500
php_value   session.gc_probability   1
</IfModule>

<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico

# security rules:
# - deny access to files not containing a dot or starting with a dot
#   in all locations except installer directory
RewriteRule ^(?!installer|\.well-known\/|[a-zA-Z0-9]{16})(\.?[^\.]+)$ - [F]
# - deny access to some locations
RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
# - deny access to composer binaries
RewriteRule ^/vendor\/bin\/.* - [F]
# - deny access to some documentation files
RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml|jsdeps.json|Dockerfile)$ - [F]
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>

FileETag MTime Size

<IfModule mod_autoindex.c>
Options -Indexes
</ifModule>

<IfModule mod_headers.c>
# Disable page indexing
Header set X-Robots-Tag "noindex, nofollow"

# replace 'append' with 'merge' for Apache version 2.2.9 and later
#Header append Cache-Control public env=!NO_CACHE

# Optional security header
# Only increased security if the browser support those features
# Be careful! Testing is required! They should be adusted to your intallation / user environment

# HSTS - HTTP Strict Transport Security
#Header always set Strict-Transport-Security "max-age=31536000; preload" env=HTTPS

# HPKP - HTTP Public Key Pinning
# Only template - fill with your values
#Header always set Public-Key-Pins "max-age=3600; report-uri=\"\"; pin-sha256=\"\"; pin-sha256=\"\"" env=HTTPS

# X-Xss-Protection
# This header is used to configure the built in reflective XSS protection found in Internet Explorer, Chrome and Safari (Webkit).
#Header set X-XSS-Protection "1; mode=block"

# X-Frame-Options
# The X-Frame-Options header (RFC), or XFO header, protects your visitors against clickjacking attacks
# Already set by php code! Do not activate both options
#Header set X-Frame-Options SAMEORIGIN

# X-Content-Type-Options
# It prevents Google Chrome and Internet Explorer from trying to mime-sniff the content-type of a response away from the one being declared by the server.
#Header set X-Content-Type-Options: "nosniff"

# CSP - Content Security Policy
# for better privacy/security ask browsers to not set the Referer
# more flags for script, stylesheets and images available, read RFC for more information
#Header set Content-Security-Policy "referrer no-referrer"
</IfModule>

This is the default file - I never edited it (but reading the code - I will actually enable CSP, so I learned something today :p).

The permissions of the file are:

Code:
-rw-r--r--   1 webapps  webapps

So chown webapps:webapps and chmod 644 is needed.
 
Last edited:
Thank you for your reply Wattie.
Regarding local-infile=0 - it must be under [mysqld] section of my.cnf.
I normally had it there, but now on Centos 7 I've got Mariadb by default, which has a my.cnf that looks like this:
Code:
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
In that /etc/my.cnf.d directory there are several files including a server.cnf which has a [mysqld] section which contains that line, so in fact that's the same as if I would put it in the /etc/my.cnf then correct?

My /var/www/html already has the correct permissions and ownerchip of webapps:webapps so that should not be an issue.

As for the .htaccess, I'm glad you could confirm this, however it still wonders me why this does not give any error on the Centos 6 servers about a missing .htaccess.

So I'm still confused.
 
Just create the file and it will be fixed.

Regarding my.cnf - I keep all in one file so I can't say. Mine works.
 
Are you on Centos 7 then with MariaDB?

I just put everything in /etc/my.cnf and as I thought it doesn't make any difference:
Code:
/usr/bin/mysqlshow: unknown variable 'local-infile=0'

This is only on the Centos 7 server with MariaDB, no issues on the Centos 6 server.
 
I thought so already read it somewhere else. So that can't be really compared.

Hopefully somebody else has a solution.
Got another problem with Mariadb too, but will make a new post about that. I wish I had not installed Mariadb.
 
@Richard G, All my servers is on CentOS 7 and is running MariaDB 10.1.x, so far I have not had any problems related to MariaDB.

However I am still on Roundcube 1.3.6. After reading the forum post about trouble with 1.3.7, I have been waiting for confirmation that it is solved before I upgrade Roundcube.

What I wonder about, is if the my.cnf problem with local-infile=0 is specific for Roundcube 1.3.7, or if it happens with Roundcube 1.3.6 also? If it happens with Roundcube 1.3.6 also, then it is not Roundcube that is the problem, because I am running Roundcube 1.3.6 and MariaDB with local-infile=0 in /etc/my.cnf without problems.

Maybe you could post the content of your /etc/my.cnf? And also post the content of the other my.cnf you have in other paths? Maybe I or someone else can see a problem then?
 
@Ditto: Thank you for your reply.

I've found the cause of the local-infile error. It was coming from the client.cnf in the /etc/my.cnf.d/client.cnf file.
I'm not sure anymore if I put that there myself. Probably for some testing reasons because of errors before, but after removing it there, that error is gone. We got a saying in Dutch "not being able the see the forest through the trees", which means something like looking at so many things to find a cause, that you loose sight of things.

Still... why do I have these errors on Centos 7 with Mariadb?
Code:
ERROR 1007 (HY000) at line 1: Can't create database 'da_roundcube'; database exists
ERROR 1050 (42S01) at line 8 in file: 'SQL/mysql.initial.sql': Table 'session' already exists
ERROR 1050 (42S01) at line 20 in file: 'SQL/mysql.initial.sql': Table 'users' already exists

and the .htaccess thing:
Code:
grep: /var/www/html/roundcubemail-1.3.7/.htaccess

Both ONLY on the Centos 7 server, while I don't have a .htaccess there on the Centos 6 servers, but they do not give this error notice. And on Centos 6 I don't see these mysql errors. At least the .htaccess should give the same error correct?

I could ignore the "table already exists" errors probably, but still.. where is this coming from?


The problem I'm having with Mariadb is that on this server when restarting mysqld and mariadb, something happens (a timeout?) which makes radio streams from MediaCP and Centovacast stop working. I didn't have this issue on any Centos 6 server with plain Mysql ever. But that's off-topic here, I send in a ticket for that issue.
 
[cut]I could ignore the "table already exists" errors probably, but still.. where is this coming from?[cut]

I am just guessing here, it might be that DirectAdmin try to install Roundcube from scratch every time you do ./build roundcube if you do not have it set to "yes".

Do you have roundcube=yes in custombuild/options.conf? If not change it to yes and try to do ./build roundcube two times, maybe the second time the database errors will go away.

I really don't know about the other things you mention, as I have not seen any problems like this on my servers.
 
I have roundcube=yes on every server in options.conf, doing that with roundcube and mysql amongst others is one of the first things I do when installing a new server. I always install them the same way and then compare options.conf and directadmin.conf files afterwards to see if I did not forget anything.

Wattie said the .htaccess should be there as also Roundcube's repo mentiones it. That's why I'm confused there is no .htaccess on the Centos 6 servers and they don't spread that error.

It's not really a problem because roundcube is build and is working too, it's just error notices which i don't like on building things and which should not be there imho.
 
What I wonder about, is if the my.cnf problem with local-infile=0 is specific for Roundcube 1.3.7, or if it happens with Roundcube 1.3.6 also?

The error has nothing to do with Roundcube!

Regarding the update of Roundcube - don't worry, it's not a problem to update. Just make sure to create the .htaccess file after the update and put the code from Github in it. The build errors are related to some issue with the Richard's setup.

I've found the cause of the local-infile error. It was coming from the client.cnf in the /etc/my.cnf.d/client.cnf file.

I told you already - it has to be under [mysqld]. Yours was under [client]. It does not matter if everything is inside one file (/etc/my.conf like in my case) or it is split in many.

Wattie said the .htaccess should be there as also Roundcube's repo mentiones it. That's why I'm confused there is no .htaccess on the Centos 6 servers and they don't spread that error.

It's not really a problem because roundcube is build and is working too, it's just error notices which i don't like on building things and which should not be there imho.

Please do create the .htaccess file and put inside the official code from the github repo! Don't leave your installation without it.
 
I told you already - it has to be under [mysqld]. Yours was under [client].
I know that it has to be under [mysqld] and I had it there as I already wrote before. So I did not expect it to be on a second place in a seperate file...... trees and forest, you know the saying since your Dutch languaged if I'm not mistaken.

Please do create the .htaccess file and put inside the official code from the github repo! Don't leave your installation without it.
Thank you. I know I can make it myself, but that does not explain (if it's so important) why there is no error notice about it's missing on Centos 6 servers also.

Since the Centos 6 servers also don't give the "table already exist" error notices, I'm starting to wonder if it could be that some kind of error display is disabled in some way. Can't imagine doing that, but one never knows.
 
If the .htaccess is already there, there is no error message.

For example I created it, then rebuilt roundcube - no error. It is some akward issue with the recent update from 1.4.6 to 1.4.7. Maybe DA tried to replace it and failed... or something like this. I don't know. DA support must investigate that.

The "table already exist" is weird. As said before, it looks like it's trying to install, not upgrade.
 
Last edited:
If the .htaccess is already there, there is no error message.
Correct, but as I already state before, the .htaccess is -not- there on the C6 servers, so it's weird that there is no error message.

As for the table errors, it might be fixed, but don't ask me how.
It looked indeed as if it was trying to install instead of upgrade. I had a custom config.inc.php which I had removed before to see if that was the cause but it wasn't the cause, the errors kept coming.

Now it gets really weird. I just put back the custom config.inc.php again a moment ago and did ./build roundcube again and the table errors were gone.
So to be sure I removed the custom config again to test, but the "table exists" errors don't appear anymore, with or without the custom config.inc.php does not make a difference. Never seen this before.

The only thing remaining now is the non-existing .htaccess on the Centos 6 server not giving any error. Unless the .htaccess is only needed since Centos 7.
 
Last edited:
P.S. I confirm that when upgrading Roundcube to the newest version there is an issue with missing .htaccess file. We must inform the DA administrators - they need to fix that.

Here is the default .htaccess from the official repo:

https://github.com/roundcube/roundcubemail/blob/master/.htaccess

That is not an correct CSP header... They are trying to change the referrer header with the CSP header:confused:

CSP is something else.. Changing the referrer header is done with "add_header Referrer-Policy"
 
On 1 of our servers, the newest with MariaDB and Centos 7, we got a lot of errors when updating Roundcube:
Code:
[root@server22: /usr/local/directadmin/custombuild]# ./build roundcube
[B]/usr/bin/mysqlshow: unknown variable 'local-infile=0'[/B]
Inserting data to mysql and creating database/user for roundcube...
ERROR 1007 (HY000) at line 1: Can't create database 'da_roundcube'; database exists
ERROR 1050 (42S01) at line 8 in file: 'SQL/mysql.initial.sql': Table 'session' already exists
ERROR 1050 (42S01) at line 20 in file: 'SQL/mysql.initial.sql': Table 'users' already exists
ERROR 1050 (42S01) at line 37 in file: 'SQL/mysql.initial.sql': Table 'cache' already exists
ERROR 1050 (42S01) at line 51 in file: 'SQL/mysql.initial.sql': Table 'cache_shared' already exists
ERROR 1050 (42S01) at line 62 in file: 'SQL/mysql.initial.sql': Table 'cache_index' already exists
ERROR 1050 (42S01) at line 77 in file: 'SQL/mysql.initial.sql': Table 'cache_thread' already exists
ERROR 1050 (42S01) at line 91 in file: 'SQL/mysql.initial.sql': Table 'cache_messages' already exists
ERROR 1050 (42S01) at line 107 in file: 'SQL/mysql.initial.sql': Table 'contacts' already exists
ERROR 1050 (42S01) at line 126 in file: 'SQL/mysql.initial.sql': Table 'contactgroups' already exists
ERROR 1050 (42S01) at line 138 in file: 'SQL/mysql.initial.sql': Table 'contactgroupmembers' already exists
ERROR 1050 (42S01) at line 153 in file: 'SQL/mysql.initial.sql': Table 'identities' already exists
ERROR 1050 (42S01) at line 176 in file: 'SQL/mysql.initial.sql': Table 'dictionary' already exists
ERROR 1050 (42S01) at line 189 in file: 'SQL/mysql.initial.sql': Table 'searches' already exists
ERROR 1050 (42S01) at line 204 in file: 'SQL/mysql.initial.sql': Table 'system' already exists
ERROR 1062 (23000) at line 212 in file: 'SQL/mysql.initial.sql': Duplicate entry 'roundcube-version' for key 'PRIMARY'
Database created, da_roundcube password is xxxxxxxxxxxxkx
Editing roundcube configuration...
Installing custom RoundCube Config: /usr/local/directadmin/custombuild/custom/roundcube/config.inc.php
[B]grep: /var/www/html/roundcubemail-1.3.7/.htaccess: No such file or directory[/B]
Roundcube 1.3.7 has been installed successfully.
Executing database schema update.
Indexing contacts for user 1...
Indexing contacts for user 2...
Indexing contacts for user 3...
Indexing contacts for user 4...
Indexing contacts for user 5...
Indexing contacts for user 6...
Indexing contacts for user 7...
Indexing contacts for user 8...
done.
This instance of Roundcube is up-to-date.
Have fun!

I did had a custom config.inc.php for roundcube, but removed it and still have these errors.
Next to that, where is that .htaccess error coming from? I don't have a .htaccess in that location in any of our servers, however, the other (Centos 6.10) servers don't give errors about it.

...

How can I fix these errors?
Hi all!

Thanks for the report. I did not notice the error during the RC update while testing, as the login still worked.
I've updated the tar.gz pack on files1 to include the .htaccess as I couldn't see any reason in the release notes as to why it was removed.
You'll get an md5sum error when updating, but that's good, it just means the new tar.gz is being downloaded.

Note: If you're already logged into RC when you update it, you'll need to logout, then login again to get things back in sync.

John
 
YUP centos 7 updated roundcube a while ago , not having probs or error i remember.

BUT still no htaccess


# WARNING: For PHP 7 the module name in the line below need to be modified!
<IfModule mod_php7.c>
php_flag display_errors Off
php_flag log_errors On
# php_value error_log logs/errors

#php_value upload_max_filesize 5M
#php_value post_max_size 6M
#php_value memory_limit 64M

php_flag zlib.output_compression Off
php_flag suhosin.session.encrypt Off

#php_value session.cookie_path /
#php_value session.hash_function sha256
php_flag session.auto_start Off
php_value session.gc_maxlifetime 21600
php_value session.gc_divisor 500
php_value session.gc_probability 1
</IfModule>

This part id don't know how it was, and therefor also not how this should be!

For example if suhosin is enabled and so on.

Some advice please?

Maybe a directamin help file about that?
Here i only can find for custom but still also no htaccess values with explanation
https://help.directadmin.com/item.php?id=365


Also how and where if it is possible to have a same site flag session cookie for roundcube in directadmin for better security?
 
Last edited:
Back
Top