RESOLVED - Image upload error with Discourse Antivirus

Hey hi everyone,

Since 4 days now, i’ve updated Discourse and all its modules to the lastest version, but each time me or a member try to upload an image, we get this error : “undefined method `map’ for nil:NilClass”

Can’t find any infos on it, as it seems it’s a generic errors and it can be produced not only with the image uploader.

Does anyone can help here ? Any advice is welcomed. thanks a lot :slight_smile:

Can you please paste full logs with backtraces from /logs?

Hi @Falco
Thx a lot for your quick answer.

Here is my copy/paste :

    Job exception: JavaScript was terminated (either by timeout or explicitly)
27 Jun 3:47 pm
8
Job exception: Connection timed out
30 Jun 9:05 am
Mime::Type::InvalidMimeType ("%{#context['com.opensymphony.xwork2.dispatcher.httpservletresponse'].addheader('mangozda3'" is not a valid MIME type) /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/act
12 Jul 8:59 pm
Job exception: execution expired
28 Aug 8:07 am
6
ArgumentError (wrong number of arguments (given 0, expected 1..2)) app/models/user_stat.rb:157:in `calc_topic_reply_count!' lib/promotion.rb:94:in `tl2_met?' lib/promotion.rb:36:in `review_tl1' lib/pr
5 Sep 12:07 pm
2
NoMethodError (undefined method `map' for nil:NilClass) app/controllers/application_controller.rb:340:in `block in with_resolved_locale' app/controllers/application_controller.rb:340:in `with_resolved
23 Sep 6:37 pm
2
Job exception: Connection reset by peer
3 Oct 9:35 am
2
NoMethodError (undefined method `map' for nil:NilClass) app/controllers/application_controller.rb:354:in `block in with_resolved_locale' app/controllers/application_controller.rb:354:in `with_resolved
10 Oct 6:31 pm
4
Mime::Type::InvalidMimeType ("\\*\\/\\*" is not a valid MIME type) lib/middleware/omniauth_bypass_middleware.rb:68:in `call' lib/content_security_policy/middleware.rb:12:in `call' lib/middleware/anony
11 Oct 5:14 am
12
Job exception: Connection timed out
18 Oct 10:05 pm
15
Job exception: undefined method `map' for nil:NilClass
1:12 pm
356
Job exception: undefined method `map' for nil:NilClass
1:47 pm

I’ll put a screenshot for a better comprehension :

And once i clicked on the last line to open it :

Message (357 copies reported)

Job exception: undefined method `map’ for nil:NilClass

Backtrace

/usr/local/lib/ruby/2.6.0/resolv.rb:1248:in `initialize'
/var/www/discourse/plugins/discourse-antivirus/gems/2.6.6/gems/dns-sd-0.1.3/lib/dns-sd/service_instance.rb:54:in `new'
/var/www/discourse/plugins/discourse-antivirus/gems/2.6.6/gems/dns-sd-0.1.3/lib/dns-sd/service_instance.rb:54:in `initialize'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/clamav_services_pool.rb:31:in `new'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/clamav_services_pool.rb:31:in `service_instance'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/clamav_services_pool.rb:20:in `all_tcp_sockets'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/clamav.rb:24:in `update_versions'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/clamav.rb:20:in `versions'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/background_scan.rb:28:in `current_database_version'
/var/www/discourse/plugins/discourse-antivirus/lib/discourse_antivirus/background_scan.rb:52:in `scan_batch'

Hope i’ve shared it right !

discourse-antivirus is a very complex plugin that requires a lot of custom infrastructure and setup. I recommend you remove it unless you are comfortable debugging this kind of stuff yourself.

3 Likes

Indeed ! desactivating it did the job !
I feel a bit stupid… but Thanks a lot for your help :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.