OpenProject Inbound Email -- GEM Listen Error
-
NOTE: I only have Azuracast and Comentario as options for posting? Please move to the correct forum.
Hi, new Cloudron user here.
I have set up a new instance of Cloudron (8.0) and installed OpenProject (whatever the latest version is served by the App Store). The application itself is working as expected, and SMTP relay is working - so emails are being sent outward.
However, I'm facing a weird issue when I try to test the Inbound Email feature for OpenProject.
I am assuming, based on another post in the OpenProject Cloudron App forum that Cloudron users must use the cron job approach as the OpenProject Docker Daemon approach is referring to OpenProject's Docker image and not Cloudron's.
So assuming cron is the correct approach, I'm running a script which I've set up by attempting to follow the documentation here:
https://www.openproject.org/docs/installation-and-operations/configuration/incoming-emails/Essentially the script is:
bundle exec rake redmine:email:receive_imap host='imap.gmail.com' username='test_user' password='password' port=993 ssl=true ssl_verification=true allow_override=type,project project=test_project
When I test this via the OpenProject App Terminal, I get the error shown at the below. Assuming maybe it was a permission/terminal issue, I attempted to run it via a cron job that referenced an executable script to see if that worked instead. Same error. In fact, any rake commands via the terminal will generate this "Listen is not part of the bundle" error.
Jul 16 02:01:32 => Checking Inbox Jul 16 02:01:40 172.18.0.1 - - [15/Jul/2024:14:01:40 +0000] "GET / HTTP/1.1" 301 945 "-" "Mozilla (CloudronHealth)" Jul 16 02:01:45 rake aborted! **Jul 16 02:01:45 Gem::LoadError: listen is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)** Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/evented_file_update_checker.rb:3:in `<top (required)>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require' Jul 16 02:01:45 /app/code/config/environments/development.rb:43:in `block in <top (required)>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/railtie.rb:257:in `instance_eval' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/railtie.rb:257:in `configure' Jul 16 02:01:45 /app/code/config/environments/development.rb:31:in `<top (required)>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/engine.rb:568:in `block (2 levels) in <class:Engine>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/engine.rb:567:in `each' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/engine.rb:567:in `block in <class:Engine>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `instance_exec' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:32:in `run' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:61:in `block in run_initializers' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:50:in `each' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:50:in `tsort_each_child' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/initializable.rb:60:in `run_initializers' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:426:in `initialize!' Jul 16 02:01:45 /app/code/config/environment.rb:33:in `<top (required)>' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:402:in `require_environment!' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/application.rb:588:in `block in run_tasks_blocks' Jul 16 02:01:45 /app/code/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>' Jul 16 02:01:45 /root/.rbenv/versions/3.3.2/bin/bundle:25:in `load' Jul 16 02:01:45 /root/.rbenv/versions/3.3.2/bin/bundle:25:in `<main>' Jul 16 02:01:45 Tasks: TOP => redmine:email:receive_imap => environment Jul 16 02:01:45 (See full trace by running task with --trace)
I am not at all familiar with Ruby / GEM Package management and it seems it may be related to the Ruby production/development environment setting somewhere? I am a little bit lost on how to troubleshoot this issue.
You can reproduce the issue by simply typing into the OpenProject terminal:
rake redmine:email:receive_imap
orbundle exec rake redmine:email:receive_imap
Assistance would be appreciated.
-
@girish could you or someone please move this to the OpenProject forum?
Also worth noting this is Cloudron running on Ubuntu 24.04 LTS (not sure if that helps).
The original post I'm referencing is: https://forum.cloudron.io/topic/10640/incoming-email-functionality
-
-
@nebulon yep, OpenProject is a long lost Github step-child of Redmine so they share some packages. The official OpenProject documentation in the link I provided shows you the command to use.
Any ideas on whether this is a problem related to Ubuntu 24.04?
-
@nebulon yes you're right, thanks for following up. Apologies, I had worked this out, but I didn't return to this thread to update with the solution as I was still trying to determine why the workers weren't working.
So for anyone wanting to set up a similar script or cron, you're required to prepend RAILS_ENV="production" to your commands.
For example manually calling the inbound email rake:
RAILS_ENV="production" bundle exec rake redmine:email:receive_imap host='imap.gmail.com' username='test_user' password='password' port=993 ssl=true ssl_verification=true allow_override=type,project project=test_project
-
Given that the rake command arguments need to be tailored to the imap account and one can add more than one such account, the package does now not provide any scripts for this, but as @umnz pasted, adding a custom cron job with the mentioned command for each imap account via the Cloudron dashboard will solve this.
-