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

redmine:email:receive_imap -> uninitialized constant Redmine::IMAP #175

Closed
lupa18 opened this issue Sep 26, 2019 · 4 comments
Closed

redmine:email:receive_imap -> uninitialized constant Redmine::IMAP #175

lupa18 opened this issue Sep 26, 2019 · 4 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@lupa18
Copy link

lupa18 commented Sep 26, 2019

After upgrading to 4.x I got this error:
uninitialized constant Redmine::IMAP

when running redmine:email:receive_imap task.

I'm trying to figure what is happening but wihtout success. Someone can help me ?

thanks in advance

@wglambert
Copy link

Can you give all the commands you ran and any relevant contextual information or files for reproducing the issue

Looks like imap isn't configured/defined, did you do anything listed on http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Sep 26, 2019
@lupa18
Copy link
Author

lupa18 commented Sep 27, 2019

Hi @wglambert, I ran this command:

rake redmine:email:receive_imap unknown_user=accept no_permission_check=1 RAILS_ENV="production" host=$host port=$puerto ssl=true username=$casilla password=$clave ssl=1 project=$proyecto tracker=$tipo priority=$prioridad category=$categoria

(changing variables with their values)

Same command I used to ran in 3.x version and worked.

Now I'm using redmine:4 repo, so my versions are:

  • Redmine version 4.0.4.stable
  • Ruby version 2.6.4-p104 (2019-08-28) [x86_64-linux]
  • Rails version 5.2.3

and error looks like this:

** Invoke redmine:email:receive_imap (first_time)                                                                                                                                                                                                                                                                            
** Invoke environment (first_time)                                                                                                                                                                                                                                                                                           
** Execute environment                                                                                                                                                                                                                                                                                                       
** Execute redmine:email:receive_imap                                                                                                                                                                                                                                                                                        
rake aborted!                                                                                                                                                                                                                                                                                                                
NameError: uninitialized constant Redmine::IMAP                                                                                                                                                                                                                                                                              
/usr/src/redmine/lib/tasks/email.rake:121:in `block (4 levels) in <top (required)>'                                                                                                                                                                                                                                          
/usr/src/redmine/app/models/mailer.rb:612:in `with_synched_deliveries'                                                                                                                                                                                                                                                       
/usr/src/redmine/lib/tasks/email.rake:120:in `block (3 levels) in <top (required)>'                                                                                                                                                                                                                                          
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'                                                                                                                                                                                                                                                
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'                                                                                                                                                                                                                                                            
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'                                                                                                                                                                                                                                                         
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'                                                                                                                                                                                                                                 
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'                                                                                                                                                                                                                                                                
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'                                                                                                                                                                                                                                          
/usr/local/bundle/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'                                                                                                                                                                                                                                                          
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'                                                                                                                                                                                                                                              
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'                                                                                                                                                                                                                            
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'                                                                                                                                                                                                                                                     
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'                                                                                                                                                                                                                                       
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'                                                                                                                                                                                                                                         
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'                                                                                                                                                                                                                                                
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'                                                                                                                                                                                                                                              
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'                                                                                                                                                                                                                              
/usr/local/bundle/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'                                                                                                                                                                                                                                                       
/usr/local/bundle/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'                                                                                                                                                                                                                                                         
/usr/local/bundle/bin/rake:23:in `load'                                                                                                                                                                                                                                                                                      
/usr/local/bundle/bin/rake:23:in `<top (required)>'                                                                                                                                                                                                                                                                          
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'                                                                                                                                                                                                                                                                   
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'                                                                                                                                                                                                                                                            
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'                                                                                                                                                                                                                                                                    
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'                                                                                                                                                                                                                                                                       
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'                                                                                                                                                                                                                                                
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'                                                                                                                                                                                                                                 
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'                                                                                                                                                                                                                                                  
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'                                                                                                                                                                                                                                                                    
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'                                                                                                                                                                                                                                                
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'                                                                                                                                                                                                                                                                       
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'                                                                                                                                                                                                                              
/usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'                                                                                                                                                                                                                                           
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'                                                                                                                                                                                                                                       
/usr/local/bin/bundle:23:in `load'                                                                                                                                                                                                                                                                                           
/usr/local/bin/bundle:23:in `<main>'                                                                                                                                                                                                                                                                                         
Tasks: TOP => redmine:email:receive_imap

@lupa18
Copy link
Author

lupa18 commented Oct 2, 2019

I don't know why but if edit: lib/tasks/email.rake

and add:
require 'redmine/imap.rb'

it works.

How can I make this change permanent?

@wglambert
Copy link

Yeah I can't reproduce any issue with email.

Template email:

project: myproject
tracker: tracker
category:function
priority: high
status: Open
subject: subject
description: test

configuration.yml is the template from https://www.redmine.org/projects/redmine/wiki/EmailConfiguration#GMail-Google-Apps

On the web interface I populated the missing project, tracker, status, and priority when I got the error they were required

$ docker run -d -v "$PWD"/configuration.yml:/usr/src/redmine/config/configuration.yml -p 3000:3000 --rm --name redmine redmine:4
e36dc26afc2bf70f0f46192c2057dd10ad024e0c9750cb3f9590f11115d28ce6

$ docker exec -it redmine bash

root@e36dc26afc2b:/usr/src/redmine# rake redmine:email:receive_imap unknown_user=accept no_permission_check=1 RAILS_ENV=production host=imap.gmail.com port=993 ssl=1 username="$email" password="$pass"
W, [2019-10-02T22:01:18.842276 #49]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
W, [2019-10-02T22:01:20.213460 #49]  WARN -- : Creating scope :sorted. Overwriting existing method Group.sorted.
W, [2019-10-02T22:01:20.233041 #49]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
E, [2019-10-02T22:01:20.686401 #49] ERROR -- : MailHandler: Validation failed: Tracker cannot be blank, Priority cannot be blank, Status cannot be blank

root@e36dc26afc2b:/usr/src/redmine# rake redmine:email:receive_imap unknown_user=accept no_permission_check=1 RAILS_ENV=production host=imap.gmail.com port=993 ssl=1 username="$email" password="$pass"
W, [2019-10-02T22:02:21.695774 #53]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
W, [2019-10-02T22:02:23.071436 #53]  WARN -- : Creating scope :sorted. Overwriting existing method Group.sorted.
W, [2019-10-02T22:02:23.084588 #53]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
I, [2019-10-02T22:02:23.518957 #53]  INFO -- : MailHandler: issue #1 created by Anonymous

There's also this issue with email and cron #64

You could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

2 participants