YunoHost-Apps / discourse_ynh

Discourse package for YunoHost
https://www.discourse.org/
GNU General Public License v2.0
24 stars 12 forks source link

users avatar not saving when installed on a subpath #16

Closed Olm-e closed 5 years ago

Olm-e commented 5 years ago

hi, either with stable or with testing branch, there seems to have no way to have users upload and use custom avatar image. the system seems to work well up to the "upload image" where you select you image, it shows in the preview in the dialog, but when saving, bim!, back to neutral zero avatar image... the system complains with this error :

(testing seems to work well otherwise btw)

the error at the given time (with testing)

MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb

`/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/logger.rb:101:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/logger.rb:52:in `add'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/logger.rb:534:in `warn'
/var/www/discourse/lib/discourse_ip_info.rb:23:in `rescue in mmdb_load'
/var/www/discourse/lib/discourse_ip_info.rb:19:in `mmdb_load'
/var/www/discourse/lib/discourse_ip_info.rb:15:in `open_db'
/var/www/discourse/lib/discourse_ip_info.rb:10:in `initialize'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:141:in `new'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:141:in `block in instance'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:139:in `synchronize'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:139:in `instance'
/var/www/discourse/lib/discourse_ip_info.rb:91:in `get'
/var/www/discourse/app/serializers/concerns/user_auth_tokens_mixin.rb:23:in `location'
(eval):5:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in `rescue in attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:89:in `block in _serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:79:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:79:in `_serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:73:in `serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:53:in `as_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:96:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `block in jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `block in jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:35:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:22:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:41:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:in `dump'
/var/www/discourse/app/controllers/application_controller.rb:453:in `render_json_dump'
/var/www/discourse/app/controllers/users_controller.rb:88:in `block (2 levels) in show'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/mime_responds.rb:203:in `respond_to'
/var/www/discourse/app/controllers/users_controller.rb:80:in `show'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:194:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:134:in `process'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.2/lib/action_view/rendering.rb:32:in `process'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:191:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:252:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:840:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:32:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:216:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/middleware/reporter.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/static.rb:127:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/message_bus-2.2.0.pre.1/lib/message_bus/rack/middleware.rb:57:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:182:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `<top (required)>'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/opt/rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/opt/rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/opt/rbenv/versions/2.6.0/bin/bundle:23:in `load'
/opt/rbenv/versions/2.6.0/bin/bundle:23:in `<main>'`
JimboJoe commented 5 years ago

Hi, Can you confirm your problem occurred at installation time (not upgrade)? What processor architecture (x86 or ARM)?

Olm-e commented 5 years ago

it's happening after install, both with stable 2.1.8 and testing 2.2.1 version of ynh_discourse on x86

JimboJoe commented 5 years ago

OK, got it reproduced, and it only occurs when installing in a subpath. I would say it looks like an upstream bug (it seems to surprisingly use the URL subpath when accessing the image file on the disk, which is inappropriate); but I can't confirm for sure...

It would be interesting to confirm that by trying the official way of installing Discourse with Docker... any volunteer? :slightly_smiling_face:

JimboJoe commented 5 years ago

I had another look at it, and found out missing specific actions at installation for subfolder installations. So, a fix is on the way :wink:

Olm-e commented 5 years ago

hi, my instance is in 2.2.3 testing and this is still not working ...

JimboJoe commented 5 years ago

Did you upgrade it via YunoHost? What's the content of /var/www/discourse/public/forum?

Olm-e commented 5 years ago

yes I upgraded through yunohost, there is no forum dir in /var/www/discourse/public/

JimboJoe commented 5 years ago

Had you tried the testing in the meanwhile...?

Olm-e commented 5 years ago

it's on testing yes ... I don't know how to go back on master actually

JimboJoe commented 5 years ago

Sorry, I was speaking about the "discourse" testing... Where you on 2.2.2 before applying the update?

Olm-e commented 5 years ago

yes ... I did each update since 2.2.1 incrementally and tested each time ...

JimboJoe commented 5 years ago

Could you please share your upgrade logs?

Olm-e commented 5 years ago

discourse-upgradelog-222_223.txt discourse-upgradelog-221_222.txt

JimboJoe commented 5 years ago

The fix I included in the 2.2.3 release isn't executed in the logs... Hmm... How come your 2.2.3 upgrade logs are dated on the 11th, whereas I released the update today? :thinking:

Olm-e commented 5 years ago

could it be the testing branch is on 2.2.3 sooner already without the patch ?

JimboJoe commented 5 years ago

Yep, I think the mystery's solved :slightly_smiling_face:

You upgraded to the testing branch when I was still testing the 2.2.3 version, and I added the "avatar fix" afterwards.

So 2 conclusions:

So, I'll close that issue for now... but don't hesitate to re-open it if needed :wink:

Olm-e commented 5 years ago

mm... ok .... I've added the forum dir by hand (with user admin and sudo, then sudo chown discourse: ) and the symlinks but... still no luck....

after reboot (never knows) there are still the same error in the webconsole when trying to upload a jpg as avatar for a user :

 MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-City.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-City.mmdb

 MaxMindDB (/var/www/discourse/vendor/data/GeoLite2-ASN.mmdb) could not be found: No such file or directory @ rb_sysopen - /var/www/discourse/vendor/data/GeoLite2-ASN.mmdb 

with last one detail :


/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/logger.rb:101:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/logger.rb:52:in `add'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/logger.rb:534:in `warn'
/var/www/discourse/lib/discourse_ip_info.rb:23:in `rescue in mmdb_load'
/var/www/discourse/lib/discourse_ip_info.rb:19:in `mmdb_load'
/var/www/discourse/lib/discourse_ip_info.rb:15:in `open_db'
/var/www/discourse/lib/discourse_ip_info.rb:10:in `initialize'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:141:in `new'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:141:in `block in instance'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:139:in `synchronize'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/singleton.rb:139:in `instance'
/var/www/discourse/lib/discourse_ip_info.rb:91:in `get'
/var/www/discourse/app/serializers/concerns/user_auth_tokens_mixin.rb:23:in `location'
(eval):5:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in `rescue in attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:89:in `block in _serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/relation/delegation.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:79:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:79:in `_serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:73:in `serializable_array'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/array_serializer.rb:53:in `as_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:96:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `block in jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `block in jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `map'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:92:in `jsonify'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:35:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/json/encoding.rb:22:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:41:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:in `dump'
/var/www/discourse/app/controllers/application_controller.rb:453:in `render_json_dump'
/var/www/discourse/app/controllers/users_controller.rb:88:in `block (2 levels) in show'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/mime_responds.rb:203:in `respond_to'
/var/www/discourse/app/controllers/users_controller.rb:80:in `show'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:194:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/notifications.rb:168:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal/params_wrapper.rb:256:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/railties/controller_runtime.rb:24:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/abstract_controller/base.rb:134:in `process'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionview-5.2.2/lib/action_view/rendering.rb:32:in `process'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:191:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_controller/metal.rb:252:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:52:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:34:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:52:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/journey/router.rb:35:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:840:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:32:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:216:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/logster-2.0.1/lib/logster/middleware/reporter.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/rack/logger.rb:28:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2/lib/action_dispatch/middleware/static.rb:127:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/message_bus-2.2.0.pre.1/lib/message_bus/rack/middleware.rb:57:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:182:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/engine.rb:524:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/railtie.rb:190:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/unicorn-5.4.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `<top (required)>'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/opt/rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/opt/rbenv/versions/2.6.0/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/opt/rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/opt/rbenv/versions/2.6.0/bin/bundle:23:in `load'
/opt/rbenv/versions/2.6.0/bin/bundle:23:in `<main>'
JimboJoe commented 5 years ago

It should work instantaneously (I tested it by hand first)... The result on my server:


root:~# ll /var/www/discourse/public/forum/
total 0
lrwxrwxrwx 1 discourse discourse 10 mars  16 19:36 backups -> ../backups
lrwxrwxrwx 1 discourse discourse 10 mars  16 19:36 uploads -> ../uploads
Olm-e commented 5 years ago
admin@olme:~$ sudo ls -l /var/www/discourse/public/forum/
total 0
lrwxrwxrwx 1 discourse discourse 10 Mar 17 22:08 backups -> ../backups
lrwxrwxrwx 1 discourse discourse 10 Mar 17 22:08 uploads -> ../uploads

but still no avatars ... :/ ....

JimboJoe commented 5 years ago

Then maybe you're having another additional issue...? :thinking: Could you please install a second Discourse instance on the same server to confirm a similar behavior? Also, are you logging in to Discourse via LDAP or a plain user (LDAP in my case)? Could you try via LDAP if not tried? What customizations did you apply to you instance (e.g. plugin, theme, configuration items, etc.)?

And I confirm I also get the GeoLite warnings with no impact on my side.

JimboJoe commented 5 years ago

Closing this issue for now. Don't hesitate to reopen it if the problem persists and/or you have additional elements to bring in :wink:

maniackcrudelis commented 1 year ago

Same issue for me with the last version of the package, 2.8.14~ynh1.

A few hours of struggling with that issue and I've finally found out !

I got an (helpful...) error saying

Failed to optimize image: unknown reason

First thing I did was to upgrade to ImageMagick 7, using the script available in the directory of Discourse. Can't say that it did solve anything though... Or not...

The issue was still the same, I can upload, everything seems to work, but the avatar doesn't change...

But there was another error,

ActionController::MissingFile (Cannot read file /var/www/discourse/public/akana/uploads/default/original/1X/6d6bffe9f9c180bd77de86534acc374ed713df7d.jpeg)

akana is the actual sub path of the forum. I've created a symlink from /var/www/discourse/public/akana to /var/www/discourse/public/forum and it fixed the issue.

This is clearly a bug about the path of the forum, which probably comes from the hard coded forum here in the install script.