Wizard Removal Issue

Environment

Discourse Version: Current

Plugin Commit: Current

Other Plugins
unknown

Steps to Reproduce

I’ve been using your wizard plugin for a while now. I used to have a wizard that was mandatory and appeared after account setup for all users.

I removed the wizard but it turns out that there were some people who had not yet filled out the wizard who are now stuck in this weird limbo/

Any time they try to go to any category they get redirected to the wizard page I deleted and it says “[en.wizard.none]”, with a back button saying [en.wizard.return_to_site]. if you press the back button it takes you back to the main page.

Thus these users cannot view any content on the site as they are continually being brought back to the main page.

The only solution seems to be completely disabling the plugin (which I’d rather avoid as I use it for other things)

I tried recreating the wizard but it would not actually create a wizard with the same name.

I tried exporting all my wizards and reinstalling the plugin, but when I reinstalled the plugin(removed from my app.yml, restarted, added to my app.yml, restarted) all the wizards were still there and the issue was still occuring.

I am not seeing the old wizard in my wizards page so I cannot delete it. I am not really sure what to do. Let me know if you have any ideas.

Example

Logs

1 Like

@angus
Taking a look now

Actually when [en.wizard.return_to_site] button is pressed it raises error in log

NoMethodError (undefined method `required’ for nil:NilClass

backtrace: plugins/discourse-custom-wizard/controllers/custom_wizard/wizard.rb:57:in `skip’

REQUEST_URI: /w/undefined/skip
REQUEST_METHOD: PUT
HTTP_REFERER: Wizard

If I click on that same link using administrator account (also an account that previously accepted the wizard). I get message “there is no wizard here”

1 Like

@fzngagan believes he has found the cause. He will be following up later today.

1 Like

Please run this command on rails console and share the partial output with me on a PM.
UserCustomField.where(name: "redirect_to_wizard", value: "<yourwizardname>")

For one of the listings, do the following
UserCustomField.where(user_id:<user_id>, name: "redirect_to_wizard", value: "<yourwizardname>" ).destroy

The above, should fix the issue for that particular user. If this is successful, I’ll share a command to fix the issue for all users on the forum.

Replace <yourwizardname> with the name you see in the url after /w/ in the url.

I’ve got the same problem.

Here it is for mine:

Output
=> [#<UserCustomField:0x000055d55b8f9f90
  id: 18068,
  user_id: 1468,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 18 Jun 2020 10:22:15.703973000 UTC +00:00,
  updated_at: Thu, 18 Jun 2020 10:22:15.703973000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4d3f10
  id: 18069,
  user_id: 1469,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 18 Jun 2020 10:23:06.305545000 UTC +00:00,
  updated_at: Thu, 18 Jun 2020 10:23:06.305545000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4d1210
  id: 18125,
  user_id: 1476,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 23 Jun 2020 20:12:31.760434000 UTC +00:00,
  updated_at: Tue, 23 Jun 2020 20:12:31.760434000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cfe38
  id: 18132,
  user_id: 1480,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 24 Jun 2020 19:41:03.124131000 UTC +00:00,
  updated_at: Wed, 24 Jun 2020 19:41:03.124131000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cf050
  id: 18251,
  user_id: 1501,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 02 Jul 2020 08:46:13.837695000 UTC +00:00,
  updated_at: Thu, 02 Jul 2020 08:46:13.837695000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4ce998
  id: 18256,
  user_id: 1502,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 03 Jul 2020 09:26:44.423982000 UTC +00:00,
  updated_at: Fri, 03 Jul 2020 09:26:44.423982000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4ce0d8
  id: 18258,
  user_id: 1503,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 05 Jul 2020 20:32:31.296387000 UTC +00:00,
  updated_at: Sun, 05 Jul 2020 20:32:31.296387000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cdc00
  id: 18404,
  user_id: 1522,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 06 Jul 2020 12:41:10.751365000 UTC +00:00,
  updated_at: Mon, 06 Jul 2020 12:41:10.751365000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cd2a0
  id: 18436,
  user_id: 1531,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 07 Jul 2020 22:42:35.090752000 UTC +00:00,
  updated_at: Tue, 07 Jul 2020 22:42:35.090752000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4ccf58
  id: 18466,
  user_id: 1516,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 08 Jul 2020 20:14:46.402275000 UTC +00:00,
  updated_at: Wed, 08 Jul 2020 20:14:46.402275000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cccd8
  id: 18496,
  user_id: 1539,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 17 Jul 2020 03:26:43.286759000 UTC +00:00,
  updated_at: Fri, 17 Jul 2020 03:26:43.286759000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cc878
  id: 18510,
  user_id: 1541,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 20 Jul 2020 09:59:36.433690000 UTC +00:00,
  updated_at: Mon, 20 Jul 2020 09:59:36.433690000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cbf40
  id: 18528,
  user_id: 1544,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 22 Jul 2020 10:17:28.855596000 UTC +00:00,
  updated_at: Wed, 22 Jul 2020 10:17:28.855596000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cb8d8
  id: 18585,
  user_id: 1547,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 27 Jul 2020 05:13:58.193202000 UTC +00:00,
  updated_at: Mon, 27 Jul 2020 05:13:58.193202000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cb388
  id: 18832,
  user_id: 1570,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 19 Aug 2020 01:20:53.846917000 UTC +00:00,
  updated_at: Wed, 19 Aug 2020 01:20:53.846917000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4cac58
  id: 18879,
  user_id: 1576,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 20 Aug 2020 06:35:16.134776000 UTC +00:00,
  updated_at: Thu, 20 Aug 2020 06:35:16.134776000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4ca078
  id: 18950,
  user_id: 1583,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 23 Aug 2020 04:37:53.894310000 UTC +00:00,
  updated_at: Sun, 23 Aug 2020 04:37:53.894310000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4c46a0
  id: 19003,
  user_id: 1596,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 31 Aug 2020 20:14:06.642375000 UTC +00:00,
  updated_at: Mon, 31 Aug 2020 20:14:06.642375000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4c3ac0
  id: 19018,
  user_id: 1598,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 04 Sep 2020 23:33:47.210530000 UTC +00:00,
  updated_at: Fri, 04 Sep 2020 23:33:47.210530000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4c0e60
  id: 19022,
  user_id: 572,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 07 Sep 2020 09:01:15.724673000 UTC +00:00,
  updated_at: Mon, 07 Sep 2020 09:01:15.724673000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4c0938
  id: 19115,
  user_id: 1610,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sat, 12 Sep 2020 03:59:06.369304000 UTC +00:00,
  updated_at: Sat, 12 Sep 2020 03:59:06.369304000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4bee80
  id: 19464,
  user_id: 1641,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 01 Oct 2020 01:20:16.949008000 UTC +00:00,
  updated_at: Thu, 01 Oct 2020 01:20:16.949008000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4bea20
  id: 19466,
  user_id: 1643,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 02 Oct 2020 04:56:17.146485000 UTC +00:00,
  updated_at: Fri, 02 Oct 2020 04:56:17.146485000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4be048
  id: 19470,
  user_id: 1645,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 06 Oct 2020 08:19:21.142508000 UTC +00:00,
  updated_at: Tue, 06 Oct 2020 08:19:21.142508000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4baa10
  id: 19597,
  user_id: 1657,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 15 Oct 2020 08:50:00.048376000 UTC +00:00,
  updated_at: Thu, 15 Oct 2020 08:50:00.048376000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b88f0
  id: 19632,
  user_id: 1659,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sat, 17 Oct 2020 17:34:22.163576000 UTC +00:00,
  updated_at: Sat, 17 Oct 2020 17:34:22.163576000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b7720
  id: 19661,
  user_id: 1663,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 21 Oct 2020 19:16:26.052588000 UTC +00:00,
  updated_at: Wed, 21 Oct 2020 19:16:26.052588000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b7270
  id: 19679,
  user_id: 1665,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sat, 24 Oct 2020 04:01:59.006426000 UTC +00:00,
  updated_at: Sat, 24 Oct 2020 04:01:59.006426000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b63c0
  id: 19842,
  user_id: 1682,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 01 Nov 2020 01:52:01.274495000 UTC +00:00,
  updated_at: Sun, 01 Nov 2020 01:52:01.274495000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b4138
  id: 19843,
  user_id: 1676,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 01 Nov 2020 01:53:37.717007000 UTC +00:00,
  updated_at: Sun, 01 Nov 2020 01:53:37.717007000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b34b8
  id: 19844,
  user_id: 1677,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 01 Nov 2020 01:54:06.604660000 UTC +00:00,
  updated_at: Sun, 01 Nov 2020 01:54:06.604660000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b2b58
  id: 19845,
  user_id: 1675,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 01 Nov 2020 01:54:35.295991000 UTC +00:00,
  updated_at: Sun, 01 Nov 2020 01:54:35.295991000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b1988
  id: 20023,
  user_id: 1704,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 05 Nov 2020 22:48:18.842855000 UTC +00:00,
  updated_at: Thu, 05 Nov 2020 22:48:18.842855000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b1500
  id: 20123,
  user_id: 1716,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 10 Nov 2020 20:00:13.825069000 UTC +00:00,
  updated_at: Tue, 10 Nov 2020 20:00:13.825069000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b0f10
  id: 20138,
  user_id: 1718,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 18 Nov 2020 23:21:35.393610000 UTC +00:00,
  updated_at: Wed, 18 Nov 2020 23:21:35.393610000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4b03a8
  id: 20144,
  user_id: 1719,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sat, 21 Nov 2020 20:31:01.411340000 UTC +00:00,
  updated_at: Sat, 21 Nov 2020 20:31:01.411340000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4acbe0
  id: 20242,
  user_id: 1728,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 03 Dec 2020 04:19:16.121896000 UTC +00:00,
  updated_at: Thu, 03 Dec 2020 04:19:16.121896000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4ac190
  id: 20305,
  user_id: 1737,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Mon, 11 Jan 2021 02:08:45.263452000 UTC +00:00,
  updated_at: Mon, 11 Jan 2021 02:08:45.263452000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a7578
  id: 20368,
  user_id: 1750,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 04 Feb 2021 08:32:00.831961000 UTC +00:00,
  updated_at: Thu, 04 Feb 2021 08:32:00.831961000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a66c8
  id: 20369,
  user_id: 1749,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 04 Feb 2021 08:32:11.988745000 UTC +00:00,
  updated_at: Thu, 04 Feb 2021 08:32:11.988745000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a3428
  id: 20381,
  user_id: 1751,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 04 Feb 2021 20:19:29.199093000 UTC +00:00,
  updated_at: Thu, 04 Feb 2021 20:19:29.199093000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a2398
  id: 20383,
  user_id: 1752,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 04 Feb 2021 20:39:01.705804000 UTC +00:00,
  updated_at: Thu, 04 Feb 2021 20:39:01.705804000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a1a88
  id: 20397,
  user_id: 1756,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 05 Feb 2021 02:09:55.483799000 UTC +00:00,
  updated_at: Fri, 05 Feb 2021 02:09:55.483799000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4a0bd8
  id: 20398,
  user_id: 1755,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Fri, 05 Feb 2021 02:09:59.067250000 UTC +00:00,
  updated_at: Fri, 05 Feb 2021 02:09:59.067250000 UTC +00:00>,
 #<UserCustomField:0x000055d55b49fcd8
  id: 20432,
  user_id: 1761,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 17 Feb 2021 06:43:37.109903000 UTC +00:00,
  updated_at: Wed, 17 Feb 2021 06:43:37.109903000 UTC +00:00>,
 #<UserCustomField:0x000055d55b49eec8
  id: 20436,
  user_id: 1763,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sat, 27 Feb 2021 19:27:46.162915000 UTC +00:00,
  updated_at: Sat, 27 Feb 2021 19:27:46.162915000 UTC +00:00>,
 #<UserCustomField:0x000055d55b49e608
  id: 20472,
  user_id: 1767,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Wed, 17 Mar 2021 20:34:26.897498000 UTC +00:00,
  updated_at: Wed, 17 Mar 2021 20:34:26.897498000 UTC +00:00>,
 #<UserCustomField:0x000055d55b49c1a0
  id: 20611,
  user_id: 1784,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 11 Apr 2021 23:51:28.060426000 UTC +00:00,
  updated_at: Sun, 11 Apr 2021 23:51:28.060426000 UTC +00:00>,
 #<UserCustomField:0x000055d55b49a6e8
  id: 20612,
  user_id: 1780,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 11 Apr 2021 23:51:30.592414000 UTC +00:00,
  updated_at: Sun, 11 Apr 2021 23:51:30.592414000 UTC +00:00>,
 #<UserCustomField:0x000055d55b4979e8
  id: 20616,
  user_id: 1781,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Sun, 11 Apr 2021 23:51:34.121011000 UTC +00:00,
  updated_at: Sun, 11 Apr 2021 23:51:34.121011000 UTC +00:00>,
 #<UserCustomField:0x000055d55b494e78
  id: 20683,
  user_id: 1791,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 13 Apr 2021 03:38:12.132621000 UTC +00:00,
  updated_at: Tue, 13 Apr 2021 03:38:12.132621000 UTC +00:00>,
 #<UserCustomField:0x000055d55b494428
  id: 20700,
  user_id: 1798,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Tue, 13 Apr 2021 18:48:02.496680000 UTC +00:00,
  updated_at: Tue, 13 Apr 2021 18:48:02.496680000 UTC +00:00>,
 #<UserCustomField:0x000055d55b494040
  id: 20725,
  user_id: 1810,
  name: "redirect_to_wizard",
  value: "welcome",
  created_at: Thu, 15 Apr 2021 06:59:44.571180000 UTC +00:00,
  updated_at: Thu, 15 Apr 2021 06:59:44.571180000 UTC +00:00>]

Unfortunately this doesn’t work for me:

This should fix it.

UserCustomField.where(name: "redirect_to_wizard", value: "<yourwizardname>").destroy_all

Note: We’ve fixed the issue in the plugin itself. So, on the lastest commit, any wizard that is deleted after updating the code should not result in this behaviour.

1 Like