Plugin post-voting conflicts with previous question-answer-plugin

Hey there !

Big conflict on my Discourse since the change…

  1. Before i had :
- git clone https://github.com/discourse/discourse-question-answer
  1. Today i wanted to add :
- git clone https://github.com/discourse/discourse-question-answer
- git clone https://github.com/discourse/discourse-post-voting

I obtained a conflict between the two :

Summary
I, [2022-12-09T10:13:26.139287 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
/var/www/discourse/plugins/discourse-question-answer/lib/question_answer/engine.rb:4: warning: already initialized constant QuestionAnswer::CREATE_AS_QA_DEFAULT
/var/www/discourse/plugins/discourse-post-voting/lib/question_answer/engine.rb:4: warning: previous definition of CREATE_AS_QA_DEFAULT was here
/var/www/discourse/plugins/discourse-question-answer/app/controllers/question_answer/votes_controller.rb:75: warning: already initialized constant QuestionAnswer::VotesController::VOTERS_LIMIT
/var/www/discourse/plugins/discourse-post-voting/app/controllers/question_answer/votes_controller.rb:75: warning: previous definition of VOTERS_LIMIT was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_vote.rb:7: warning: already initialized constant QuestionAnswerVote::VOTABLE_TYPES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_vote.rb:7: warning: previous definition of VOTABLE_TYPES was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:7: warning: already initialized constant QuestionAnswerComment::COOKED_VERSION
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:7: warning: previous definition of COOKED_VERSION was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:26: warning: already initialized constant QuestionAnswerComment::MARKDOWN_FEATURES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:26: warning: previous definition of MARKDOWN_FEATURES was here
/var/www/discourse/plugins/discourse-question-answer/app/models/question_answer_comment.rb:31: warning: already initialized constant QuestionAnswerComment::MARKDOWN_IT_RULES
/var/www/discourse/plugins/discourse-post-voting/app/models/question_answer_comment.rb:31: warning: previous definition of MARKDOWN_IT_RULES was here
/var/www/discourse/plugins/discourse-question-answer/extensions/topic_extension.rb:9: warning: already initialized constant Topic::QA_SUBTYPE
/var/www/discourse/plugins/discourse-post-voting/extensions/topic_extension.rb:9: warning: previous definition of QA_SUBTYPE was here
rake aborted!
ArgumentError: Invalid route name, already in use: 'question_answer' 
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here: 
https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:587:in `add_route'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1986:in `add_route'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1957:in `decomposed_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1921:in `block in map_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1915:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1915:in `map_match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:1663:in `match'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/mapper.rb:642:in `mount'
/var/www/discourse/plugins/discourse-question-answer/config/routes.rb:16:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:427:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:427:in `eval_block'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `block in finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-6.1.6.1/lib/action_dispatch/routing/route_set.rb:434:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:51:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:51:in `finalize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:22:in `reload!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:35:in `block in updater'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/file_update_checker.rb:83:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/routes_reloader.rb:10:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application/finisher.rb:195:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:391:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:88:in `register'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:332:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:367:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2022-12-09T10:13:36.170591 #1]  INFO -- : gem install rrule -v 0.4.4 -i /var/www/discourse/plugins/discourse-calendar/gems/2.7.6 --no-document --ignore-dependencies --no-user-install
Successfully installed rrule-0.4.4
1 gem installed



FAILED
--------------------
  1. Then i removed the first one. Build is ok but the app is no longer running :
    • I got an HTTP 500
    • nginx error logs give me something like :
    root@slazvmeutp01:/opt/discourse# cat /var/opt/discourse/var-log/nginx/error.log
    2022/12/09 10:47:34 [notice] 537#537: signal process started
    2022/12/09 10:47:37 [error] 554#554: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 18.156.156.214, server: _, request: "POST /message-bus/76e1bd78eedf43a5a337b6f44a8b88d0/poll?dlp=t HTTP/2.0", upstream: "http://127.0.0.1:3000/message-bus/76e1bd78eedf43a5a337b6f44a8b88d0/poll?dlp=t", host: "mydiscourse.domain.com", referrer: "https://mydiscourse.domain.com/admin/plugins"
    2022/12/09 10:59:08 [crit] 554#554: *398 SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking, client: 212.102.40.218, server: 0.0.0.0:443
    2022/12/09 11:25:50 [notice] 530#530: signal process started
    

I noticed that Git repo https://github.com/discourse/discourse-question-answer now redirects to the second https://github.com/discourse/discourse-post-voting.
So it would explain the conflict on first build today.
But what about now ? It mentions TLS error rather than a plugin error…

Any idea ?

1 Like

Only having discourse-post-voting is the right move. :+1:

I’m not sure about nginx error logs, but I don’t suppose you also have discourse-feature-voting in your plugins too, do you?

2 Likes

OMG you were right !!
I had it too and I can see Git repo also redirects to https://github.com/discourse/discourse-post-voting !! :scream_cat:

But wait… topic-voting AND q&a merged into post-voting ? Are features cumulated ?

So here is my latest plugin list :

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-openid-connect
          - git clone https://github.com/discourse/discourse-solved
          - git clone https://github.com/discourse/discourse-yearly-review
          - git clone https://github.com/discourse/discourse-checklist
          - git clone https://github.com/discourse/discourse-docs
          - git clone https://github.com/discourse/discourse-reactions
            #- git clone https://github.com/discourse/discourse-feature-voting
          - git clone https://github.com/discourse/discourse-calendar
            #- git clone https://github.com/discourse/discourse-gamification
          - git clone https://github.com/discourse/discourse-gamification && cd discourse-gamification && git checkout 6a399b4c220f31de62049504d27ff6e50611fbef
          - git clone https://github.com/discourse/discourse-follow
          - git clone https://github.com/discourse/discourse-spoiler-alert
          - git clone https://github.com/paviliondev/discourse-news
          - git clone https://github.com/cfstras/discourse-konami.git
            #- git clone https://github.com/discourse/discourse-question-answer
          - git clone https://github.com/discourse/discourse-post-voting

Discourse finally responds.
But now other problems :

  1. Plugin admin show “question & answer”…
  2. When I create a topic, the item menu is not good :
    image
  3. Config in category settings always show q&a
    image

So it seems q&a is always there…

1 Like

Nope I am wrong !
This is separate projects sorry.

2 Likes

discourse-feature-voting was the old name for Discourse Topic Voting, and having the old name in there causes some loading conflicts when you also have post-voting in there as well. If you add the new discourse-topic-voting you should be able to have both again. :+1:

I’m not sure why you have the old Q&A format still? I notice you’re checking out a specific Gamification version - is that because you’re locked to a certain compatibility?

1 Like

Yes !
I am the one who tracks “stable” version of Discourse :sweat_smile:
This is a workaround I mentioned here : Database migrate fails in "stable" version - #2 by gmoirod

Ok I am going for a test right now

Me neither :sob:

1 Like

The official post-voting plugin was renamed to ‘post-voting’ relatively recently, and was Q&A in the UI, etc for a while. It may be that your install is not picking up those changes as you’re tracking Stable?

1 Like

Is there a way to properly “uninstall” a plugin ?
I could use that ton uninstall q&a and post-voting, then reinstall post-voting…

1 Like

When you check your /admin/upgrade page, what version number do you see next to post-voting?

My test-passed, up-to-date one is: 5ea4dccf

Edit: I corrected the page address :slight_smile:

1 Like

Seems ok to have topic-voting now.

I do not have a /plugins page :thinking:
But on the /admin/upgrade page I got :
image

  1. Do not have post-voting
  2. q&a shows without green check
1 Like

It looks like you’re locked at this commit from September when it was still question-answer:

Are you up-to-date with the Stable version? What version are you currently on?

1 Like

image
It seems good.



New problem…

  1. I removed post-voting and topic-voting and rebuilt app to try starting from something clean (q&a is not listed too since many attempts) : ok, no more plugins
  2. I brought back post-voting and topic-voting and now rebuild fails…
Summary
I, [2022-12-09T14:27:32.724323 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile'
Failed to update 'Discourse Loading Slider': Timeout::Error
rake aborted!
Timeout::Error: Timeout::Error
/var/www/discourse/lib/final_destination/resolver.rb:28:in `block in lookup'
/var/www/discourse/lib/final_destination/resolver.rb:7:in `synchronize'
/var/www/discourse/lib/final_destination/resolver.rb:7:in `lookup'
/var/www/discourse/lib/final_destination/ssrf_detector.rb:84:in `lookup_ips'
/var/www/discourse/lib/final_destination/ssrf_detector.rb:64:in `lookup_and_filter_ips'
/var/www/discourse/lib/theme_store/git_importer.rb:139:in `block in clone_http!'
/var/www/discourse/lib/theme_store/git_importer.rb:131:in `each'
/var/www/discourse/lib/theme_store/git_importer.rb:131:in `clone_http!'
/var/www/discourse/lib/theme_store/git_importer.rb:93:in `clone!'
/var/www/discourse/lib/theme_store/git_importer.rb:18:in `import!'
/var/www/discourse/app/models/remote_theme.rb:126:in `update_remote_version'
/var/www/discourse/lib/tasks/themes.rake:62:in `block in update_themes'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block (2 levels) in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `loop'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:137:in `find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:70:in `find_each'
/var/www/discourse/lib/tasks/themes.rake:56:in `update_themes'
/var/www/discourse/lib/tasks/themes.rake:87:in `block (2 levels) in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:90:in `each_connection'
/var/www/discourse/lib/tasks/themes.rake:86:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => themes:update
(See full trace by running task with --trace)
I, [2022-12-09T14:27:49.987988 #1]  INFO -- : Checking 'Modern Category + Group Boxes' for 'default'... up to date
Checking 'Dark-Light Toggle' for 'default'... updating from cd221006 to 3f72c88f
Checking 'Discourse Loading Slider' for 'default'... 


FAILED
--------------------
1 Like

Rebuild again and it passed.
So the last problem with 'Discourse Loading Slider' was just a glitch.
Forget that.

My main problem is that q&a remains instead of post-voting…

2 Likes

I think this may be a consequence of the build you’re using and compatibility. If you look at what should be discourse-topic-voting it’s showing on your page as discourse-voting still as well.

1 Like

So you mean I should use ‘tests-passed’ version of discourse ?

1 Like

If you want the latest versions of things. :slightly_smiling_face:

1 Like

I would prefer a ‘working’ versions of things actually :sweat_smile:
I know there is topic about version to use pretending ‘tests-passed’ is good-to-go.
But I am a kind of a ‘debian guy’ you know… Stability for production !

2 Likes

I think that’s a fine choice too. :+1: :slightly_smiling_face: The flipside is that you’ll need to wait for Version 3.0 to launch in the new year before you can get these latest updates working with Stable.

1 Like

Okay…

This is a bit disappointing that plugin management do not offer a way to follow a given git ref.
And that plugins follow Discourse lifecycle.
So that you can globally follow ‘stable’ for discourse AND plugins.

Actually each rebuild, or plugin adoption, feels like a roulette wheel.

1 Like

I’m afraid my knowledge about the Stable branch is fairly limited, but I think it’s geared more towards not changing things very often. So I would think adding new plugins and extras outside of a Stable release window would be counter-intuitive to that?

It’s also worth saying that most Discourse sites use tests-passed and generally don’t have any notable issues. Even following test-passed doesn’t mean you need to update every day though and be on the very latest version, so it’s not as changeable as you may think. You would manually have to press the update button from your /upgrade page, or perform a rebuild, to pull those changes into your site.

Managed hosting also makes this process easier too as an alternative, as they’ll handle all of the technical stuff and let you concentrate on your community. :+1:

1 Like