Common Redmine Installation & Update troubles
Since both Redmine and Easy Redmine are Open Source and are more or less platform independent, some installation & upgrade problems may occur due to various server configurations, software versions or plugins installed. We work hard to track those most common in order to help you with troubleshooting.
During application update an error message containing "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ..." appears in the log.
Cause
It means your database is outdated and it can't work with the request our application sends to it. It just doesn't understand it.
Solution
You need to update your database.
How to update the database?
Detailed description in the Knowledge base.
You have installed or updated Easy Redmine under user with insufficient permissions, not following our strong recommendation in the instructions (at least once in the past).
- Correct permissions by commands chgrp and chown according to server settings (eg. chgrp -R www-data public_html)
- Run installation again bundle exec rake easyproject:install RAILS_ENV=production which will clear cache (if you run it by root, it will not be succesful)
- Restart server
If you are using virtual machine provided by Easy Software, run under user easy:
sudo chown -R easy /home/easy/current
(in older machines - sudo chown -R easy /srv/easyredmine/public_html)
sudo chgrp -R easy /home/easy/current
(in older machines - sudo chgrp -R easy /srv/easyredmine/public_html)
cd /home/easy/current
(in older machines - cd /srv/easyredmine/public_html)
bundle exec rake easyproject:install RAILS_ENV=production
sudo service puma@your.domain.name restart
Remember to set the permissions for all necessary folders.
Here are some hints what you can do if you run into 500 error.
- run Easy server requirements check and try to repair failed validations
- back-up your database
- download the latest package from the Client Zone
- make sure that webserver has Full access public, files, log, tmp folders
- run bundle install --without development test
- run bundle exec rake easyproject:install RAILS_ENV=production
- restart application server
- delete any 3rd parties' Redmine plugins (also from database)
- write us on support@easyredmine.com and attach log/production.log
There are many possible causes of this error. Here are a few tips:
- browser cache problem - try deleting cache from the browser
- dns problem
- server setting problem
First check your connection and network (verify that server is reachable by using a ping command or traceroute command). Firewall server side.
If all above seems fine, try to get some information from nginx error.logs. Check nginx error.log at the server side - /var/log/nginx/error.log
Double check that your nginx configuration matches the standard. Standard nginx configuration can be found here:
https://www.redmine.org/projects/redmine/wiki/HowTo_configure_Nginx_to_run_Redmine
Example of an nginx configuration (as is used by Easy Software). It's quite similar to official one only few variables are optimized:
user www-data;
worker_processes 8;
worker_rlimit_nofile 60000;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 10240;
# multi_accept on;
}
http {
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # dont use SSLv3 ref: POODLE
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 2048;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
send_timeout 1800;
client_body_timeout 1800;
client_header_timeout 1800;
proxy_read_timeout 1800;
client_max_body_size 220m;
fastcgi_buffer_size 64K;
fastcgi_buffers 128 16k;
proxy_max_temp_file_size 0;
types_hash_max_size 4096;
types_hash_bucket_size 128;
proxy_busy_buffers_size 256k;
proxy_buffers 8 256k;
proxy_buffer_size 256k;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /etc/nginx/sites-auto/*;
}
Other possible causes of 502 error include...
Unicorn is not running at all, due to
- Insufficient permissions
- Wrong version of passenger
- Wrong Ruby version
- Missing gems
- Broken filesystem
To find out the exact problem, you need to check error logs in unicorn or apache + application log from Easy Redmine (log/production.log)
Timeout
If low timeout is configured, this error will appear on:
- large exports
- overload of server
- rake tasks run from the GUI
Limit of MySQL connections
Make sure you have a sufficient number of connections allowed to MySQL. It depends on the number of users, but you should have at least a 100 allowed.
This error occurs from version 2018 1.2 (platform 04.00 and higher)
Error during upgrade installation containg some of the following.
[!] There was an error parsing `Gemfile`:
[!] There was an error parsing `Gemfile`: cannot load such file --
# plugin 'rys-bundler', github: 'easysoftware/rys-bundler', branch: 'master' > Plugin.hook('rys-gemfile', self)
Bundler cannot continue.
It is caused by outdated version of redmine installer.
Solution:
Before installing the upgrade
$ gem install redmine-installer
This problems occurs when you use a suffix on your Easy Redmine URL, for example: https://company.com/easyredmine/
In this case, you need to make sure that you have the variable RAILS_RELATIVE_URL_ROOT configured to your correct suffix /easyredmine
Bitnami:
- Create an additional configuration file config/additional_environment.rb
- config.action_controller.relative_url_root = "/easyredmine"
- then precompile assets (rake easyproject:install RAILS_ENV=production) and restart the server
Make sure wkhtmltopdf is installed and running ( wkhtmltopdf needs X server or other emulation)
Test it using: "wkhtmltopdf google.com google.pdf"
Add to your proxy configuration:
proxy_set_header X-Forwarded-Proto https
Check cron configuration. It is very important that rake tasks are NOT run by root. It will cause failure due to insufficient permissions.
Let's say you are running Easy Redmine under user easy. The commands are:
View active crons crontab -u easy -l
Editing crontab -u easy -e
Apply changes sudo service cron reload
Example for running cron every 5 minutes:
*/5 * * * * /home/easy/scripts/easy_scheduler.sh &> /dev/null
#!/bin/bash -l
LOG_FILE="/home/easy/current/log/easy_scheduler_rake.log"
echo "$(date '+%Y-%m-%d %H:%M:%S') start rake" >> ${LOG_FILE}
cd /home/easy/current && bundle exec rake easyproject:scheduler:run_tasks RAILS_ENV=production >> ${LOG_FILE}
echo "$(date '+%Y-%m-%d %H:%M:%S') end rake" >> ${LOG_FILE}
/home/easy/scripts/easy_scheduler.sh has to be an executable:
sudo chmod +x /home/easy/scripts/easy_scheduler.sh
Don't hesitate to search the internet for a more precise manual to set up cron on your server. It is not an exclusively Easy Redmine required function.
When you are updating Easy Redmine on Windows platform and hit on error message ExecJs ::RuntimeError
All you have to do is install NODEJS on your system for the proper update.
If the installation fails, run manually:
$ bundle update
$ rake db:migrate
$ rake redmine:plugins:migrate
Make sure your webserver supports actual size of URL address
Make sure you are NOT using Webrick webserver!
- make sure you have the latest version of the webserver and Ruby
- reconfigure the slow filter queries in order to show less fields
- reset you CRON not to launch so often
- refer to this case study - Rails speed up without touching Ruby code
- check your configuration - https://www.easyredmine.com/resources/installation/1885-recommended-optimal-configuration-of-easy-redmine-server
Copy files folder from your old Redmine.
You can change the default files location in the Redmine's configuration file or you can use a symlink. LAN or cloud based network storages for attachments are not recommended because of reliability issues.
Configuration:
./config/configuration.yml
# Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your Redmine instance.
# Your EasyRedmine instance needs to have read/write permission on this directory.
# Examples: attachments_storage_path: /var/www/redmine/files
Troubleshooting:
If you can't open an attachment, see ./log/production.log for common errors:
Cannot send attachment, /var/www/redmine/files/2015/08/150805095407_xxx.PNG does not exist or is unreadable
ENOENT, Permission Denied... etc.
Make sure your webserver has Full access public, files, log, tmp folders
New commits into your repository are not reflected in Easy Redmine unless they are fetched by the application. You need to set webhooks on your repository client (github, gitlab, TortoiseSVN,...) with information about your Easy Redmine instance.
- Go to administration >> settings >> repositories
- Enable WS for repository management
- Generate an API key
- Save
- Go to your repository client
- Add a webhook
Let's say your site is easyredmine.company.com
For git - https://easyredmine.company.com/sys/git_fetcher
or https://easyredmine.company.com/sys/git_fetcher?key=[API key]
- depending on client setting, it can require a single URL or the key into a different field
For SVN - https://easyredmine.company.com/sys/fetch_changesets
or https://easyredmine.company.com/sys/fetch_changesets?key=[API key]
From point 5, it is all up to the repository client and not related to Easy Redmine settings. It is something you must verify after clean installation or upgrade from Redmine.
When configuring the domain of your Easy Redmine, make sure to use at least first level domain, for example http://myeasyredmine.com instead of just http://myeasyredmine . Some browsers may have problem with reaching it.
Go to Administration >> Settings >> Email notifications
and verify that the FROM address is correct.
It should be the same (or at least from the same SMTP server) as in configuration file. Otherwise some email services (gmail, yahoo, etc.) may reject notifications.
Check your configuration according to this article in Knowledge base.
To verify that the configuration is correct, try to check if can connect to the mail server from your Easy Redmine server using telnet.
telnet your.domain.here port_number_here (For example: telnet gmail.com 465)
It will show you if you really can connect to your mailserver or there is a problem in your mailserver configuration.
When you try to fo a PDF export which results in an error (or acts as if nothing happens). The production log would list error similar to
Errno::EPIPE (Broken pipe) or wkhtmltopdf: cannot connect to X server
Caused by issues with exporting component wkhtmltopdf
Here are the proposed solutions.
Headless server
Get needed version of wkhtmltopdf from http://wkhtmltopdf.org/downloads.html
Example (you have to work with details of your own environment):
- sudo apt-get install xvfb xauth
- wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
- sudo dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
- sudo apt-get -f install
- sudo mv /usr/local/bin/wkhtmltopdf /usr/local/bin/xwkhtmltopdf
- echo 'exec xvfb-run -a -s "-screen 0 640x480x16" xwkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf >/dev/null
- sudo chmod a+x /usr/local/bin/wkhtmltopdf
Non-headless server only
- You need to have wkhtmltopdf installed on your server in PATH
(apt-get install wkhtmltox, yum install wkhtmltox)
It must be installed in bundler, otherwise it may not work after updating Easy Redmine - Make sure that program works correctly (run from the console for example wkhtmltopdf https://easyredmine.com homepage.pdf)
- re-run rake easyproject:install RAILS_ENV=production
- restart server
Plugin installation
- Do NOT install plugins as a ROOT user
- First, delete all old Easy Gantt plugins if exists (plugins/easy_gantt*)
- Copy all unzipped plugins into REDMINE_ROOT/plugins
- In REDMINE_ROOT
Run: |
$ bundle install |
- (or bundle update) |
$ bundle exec rake db:migrate RAILS_ENV=production |
$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production |
After that, restart server.
Requirements for successful installation
- Redmine version: Compatible with Redmine 3.2.x, 3.3.x, 3.4.x, 4.x., 5.x.
- Ruby version: 2.3+ (recommended 2.6.)
- Database type: MySQL (recommended), PostgreSQL
Follow installation procedure in #install. Verify whether the installation log doesn't contain any errors. If it does, try to solve it according to the description, or contact support@easyredmine.com with the error section of the log attached.
Installation on Bitnami
Bitnami is not tested nor guaranteed. If the installation fails, run manually:
Run: |
$ bundle update |
$ rake db:migrate |
$ rake redmine:plugins:migrate |