Delete user feature stopped working on staging/production docker setups, but works on local (no docker setup)

Hi everyone,

I have an issue where the delete user secondary window (the one that actually deletes the user, does not show on staging/prod (docker setup), but works fine locally - no docker setup)


Nothing happens when I press delete only. On local, it proceeds to show “Deleting…” and deletes the user.

It just stopped working a few weeks ago. I was using it to delete users in December last year.

1 Like

Hi Stephan :wave:

Can you share your Discourse version?

Is there any error in the browser dev tools console?

Is there any error in the logs from your Discourse admin panel?

1 Like

Nothing anywhere, it’s like the code is not called, I looked it over locally and debugged it, it all runs ok. It’s really weird.

Installed

2.5.0.beta7

( 2a17124a5b )

2.5 is pretty old now- about two and a half years, Discourse just hit 3.0.

Is there any reason you aren’t upgrading?

3 Likes

Uh so many in fact :slight_smile:

We have a custom plugin that runs all the logic, making discourse just a tool for storing data and handling basic authorization and authentication. We run a mobile-first API that also handles the payment validation and social logins with mobile apps (custom flows) among other advanced features :slight_smile:

My issue is not really with the discourse setup as a whole, or with the version, as it was running well for 3 years and it will still run for a few years because it has no strict dependencies on anything, and we have it hosted on a dedicated server.

I really need someone to tell me how to go about finding out why when pressing the action, there is nothing happening… As I see it, it’s all javascript

destroy(opts) {
    const user = this;
    const message = I18n.t("admin.user.delete_confirm");
    const location = document.location.pathname;

    const performDestroy = function(block) {
      bootbox.dialog(I18n.t("admin.user.deleting_user"));
      let formData = { context: location };
      if (block) {
        formData["block_email"] = true;
        formData["block_urls"] = true;
        formData["block_ip"] = true;
      }
      if (opts && opts.deletePosts) {
        formData["delete_posts"] = true;
      }
      return ajax(`/admin/users/${user.get("id")}.json`, {
        type: "DELETE",
        data: formData
      })
        .then(function(data) {
          if (data.deleted) {
            if (/^\/admin\/users\/list\//.test(location)) {
              document.location = location;
            } else {
              document.location = getURL("/admin/users/list/active");
            }
          } else {
            bootbox.alert(I18n.t("admin.user.delete_failed"));
            if (data.user) {
              user.setProperties(data.user);
            }
          }
        })
        .catch(function() {
          AdminUser.find(user.get("id")).then(u => user.setProperties(u));
          bootbox.alert(I18n.t("admin.user.delete_failed"));
        });
    };

    const buttons = [
      {
        label: I18n.t("composer.cancel"),
        class: "btn",
        link: true
      },
      {
        label:
          `${iconHTML("exclamation-triangle")} ` +
          I18n.t("admin.user.delete_and_block"),
        class: "btn btn-danger",
        callback: function() {
          performDestroy(true);
        }
      },
      {
        label: I18n.t("admin.user.delete_dont_block"),
        class: "btn btn-primary",
        callback: function() {
          performDestroy(false);
        }
      }
    ];

    bootbox.dialog(message, buttons, { classes: "delete-user-modal" });
  },

Have you looked at the commits which followed that particular release?

It could just be a bug specific to that version. If it ever worked on that build I would be investigating what else has changed.

Have you updated anything since locking in at that build? Any third party plugins?

1 Like

Nope… it stopped working mid-January or so, while the app was already running. It’s very weird.

1 Like

And there are no errors in /logs or your browser console?

1 Like

This is my plugins list :slight_smile:
SCR-20230205-l51

The people at docker_manager did some things recently, https://github.com/discourse/docker_manager/commit/98205ea281ca73f0a255e6fbc919699b0623311f, that bricked my setup for a few days until I found it… But that’s kind of it.

1 Like

Have you pinned the Discourse version in your app.yml?

1 Like

If you have a custom plugin why doesn’t it appear in the plugins list? How was this instance installed?

It’s kind of hard to have something move in the config :slight_smile:

I sent the version from the deployed version, the docker is created with that version, and everything is pinned.

Well I wrote it :slight_smile:
It pulls data when the container is built and ran :slight_smile: so it’s only visible in code.

1 Like

Is there any risk the base image got updated though? Discourse_docker went up to ruby 3.1 in Jan and we’ve seen a number of older environments behave unpredictably with the change.

1 Like

Nope, the code links to a cloned branch inside our repo and the way we build the docker image, no-one has access to build another one. No way.

1 Like

So I created the last docker image around 5-6 months ago… And I still think it was pointing to the version of docker that was up when my discourse version was new :slight_smile: as we saved everything ahead of time. - Yup 24 Jun 2020 :slight_smile:

FYI: removed docker_manager as well. Nothing changed

1 Like

For now, I decided to just create a deletion flow in our admin dashboard, I’m not really sure what happens in the UI, but the DELETE endpoint works properly and does not fail for simple users (not admin, not moderators).

If anyone can help with this, it would be nice to have :slight_smile: