常见的Redmine安装和更新问题
在应用程序更新期间,日志中出现一个包含“您的SQL语法有误;请检查与您的MySQL服务器版本相对应的手册,以获取正确的语法使用方法...”的错误消息。
原因
这意味着您的数据库已过时,无法处理我们的应用程序发送的请求。它只是无法理解它。
解决方案
您需要更新您的数据库。
如何更新数据库?
在知识库中有详细说明。
您已在权限不足的用户下安装或更新了Easy Redmine,未遵循我们在说明中的强烈建议(至少在过去一次)。
- 根据服务器设置使用chgrp和chown命令更正权限(例如:chgrp -R www-data public_html)
- 再次运行安装命令bundle exec rake easyproject:install RAILS_ENV=production,这将清除缓存(如果以root身份运行,将不会成功)
- 重新启动服务器
如果您正在使用Easy Software提供的虚拟机,请在用户easy下运行:
sudo chown -R easy /home/easy/current
(在旧机器上 - sudo chown -R easy /srv/easyredmine/public_html)
sudo chgrp -R easy /home/easy/current
(在旧机器上 - sudo chgrp -R easy /srv/easyredmine/public_html)
cd /home/easy/current
(在旧机器上 - cd /srv/easyredmine/public_html)
bundle exec rake easyproject:install RAILS_ENV=production
sudo service puma@your.domain.name restart
请记得为所有必要的文件夹设置权限。
如果遇到500错误,以下是一些建议:
- 运行Easy服务器要求检查,尝试修复验证失败的问题
- 备份数据库
- 从客户区下载最新的软件包
- 确保Web服务器具有完全访问权限的public、files、log、tmp文件夹
- 运行bundle install --without development test
- 运行bundle exec rake easyproject:install RAILS_ENV=production
- 重启应用服务器
- 删除任何第三方的Redmine插件(也从数据库中删除)
- 发送邮件至support@easyredmine.com,并附上日志/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.
此错误发生在2018年1.2版本(平台04.00及更高版本)之后。
升级安装过程中出现了以下错误。
[!] 解析`Gemfile`时发生错误:
[!] 解析`Gemfile`时发生错误:无法加载此文件--
# plugin 'rys-bundler', github: 'easysoftware/rys-bundler', branch: 'master' > Plugin.hook('rys-gemfile', self)
Bundler无法继续。
这是由于过时的redmine安装程序版本引起的。
解决方案:
在安装升级之前
$ gem install redmine-installer
这个问题发生在您在Easy Redmine URL上使用后缀时,例如:https://company.com/easyredmine/
在这种情况下,您需要确保将变量RAILS_RELATIVE_URL_ROOT配置为您的正确后缀/easyredmine
Bitnami:
- 创建一个额外的配置文件config/additional_environment.rb
- config.action_controller.relative_url_root = "/easyredmine"
- 然后预编译资源(rake easyproject:install RAILS_ENV=production)并重新启动服务器
确保已安装并运行 wkhtmltopdf( wkhtmltopdf 需要 X 服务器或其他仿真器)
使用以下命令进行测试:"wkhtmltopdf google.com google.pdf"
添加到您的代理配置中:
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.
确保您的网络服务器支持URL地址的实际大小
确保您不要使用Webrick网络服务器!
- 确保您拥有最新版本的Web服务器和Ruby
- 重新配置慢速过滤器查询,以显示较少的字段
- 重置您的CRON以减少启动频率
- 参考此案例研究 - 不触碰Ruby代码的Rails加速
- 检查您的配置 - https://www.easyredmine.com/resources/installation/1885-recommended-optimal-configuration-of-easy-redmine-server
从旧的Redmine复制文件夹。
您可以在Redmine的配置文件中更改默认文件位置,或者可以使用符号链接。不建议使用局域网或云存储来存储附件,因为会出现可靠性问题。
配置:
./config/configuration.yml
# 附件存储的绝对路径。
# 默认情况下,是您的Redmine实例中的“files”目录。
# 您的EasyRedmine实例需要对此目录具有读写权限。
# 示例:attachments_storage_path: /var/www/redmine/files
故障排除:
如果无法打开附件,请查看./log/production.log以获取常见错误:
无法发送附件,/var/www/redmine/files/2015/08/150805095407_xxx.PNG不存在或不可读
ENOENT,权限被拒绝...等等。
确保您的网络服务器具有完全访问权限的公共、文件、日志、临时文件夹
除非应用程序获取,否则您的存储库中的新提交不会在Easy Redmine中反映出来。您需要在您的存储库客户端(github,gitlab,TortoiseSVN等)上设置Webhooks,并提供有关您的Easy Redmine实例的信息。
- 转到管理 >> 设置 >> 存储库
- 启用用于存储库管理的WS
- 生成API密钥
- 保存
- 转到您的存储库客户端
- 添加Webhook
假设您的站点是easyredmine.company.com
对于git - https://easyredmine.company.com/sys/git_fetcher
或 https://easyredmine.company.com/sys/git_fetcher?key=[API key]
- 根据客户端设置,可能需要一个单独的URL或将密钥放入不同的字段中
对于SVN - https://easyredmine.company.com/sys/fetch_changesets
或 https://easyredmine.company.com/sys/fetch_changesets?key=[API key]
从第5点开始,一切都取决于存储库客户端,与Easy Redmine设置无关。这是您在干净安装或从Redmine升级后必须验证的内容。
在配置您的Easy Redmine域时,请确保使用至少一级域名,例如http://myeasyredmine.com而不是仅仅使用http://myeasyredmine。某些浏览器可能无法访问它。
转到管理 >> 设置 >> 电子邮件通知
并验证 FROM 地址是否正确。
它应该与配置文件中的地址相同(或至少来自相同的 SMTP 服务器)。否则,某些电子邮件服务(如 gmail、yahoo 等)可能会拒绝通知。
根据知识库中的本文检查您的配置。
为了验证配置是否正确,请尝试从您的 Easy Redmine 服务器使用 telnet 连接到邮件服务器。
telnet your.domain.here port_number_here(例如:telnet gmail.com 465)
它将向您显示是否真的可以连接到您的邮件服务器,或者您的邮件服务器配置存在问题。
插件安装
- 不要以ROOT用户身份安装插件
- 首先,如果存在旧的Easy Gantt插件,请删除(plugins/easy_gantt*)
- 将所有解压的插件复制到REDMINE_ROOT/plugins目录下
- 在REDMINE_ROOT目录下
运行: |
$ bundle install |
- (或bundle update) |
$ bundle exec rake db:migrate RAILS_ENV=production |
$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production |
之后,重新启动服务器。
成功安装的要求
- Redmine版本:与Redmine 3.2.x、3.3.x、3.4.x、4.x兼容。
- Ruby版本:2.3+(推荐2.6)。
- 数据库类型:MySQL(推荐),PostgreSQL
按照#install中的安装过程进行操作。验证安装日志中是否没有任何错误。如果有错误,请根据描述尝试解决,或者联系support@easyredmine.com并附上日志中的错误部分。
在Bitnami上安装
Bitnami未经测试,也不保证可行。如果安装失败,请手动运行:
运行: |
$ bundle update |
$ rake db:migrate |
$ rake redmine:plugins:migrate |