Links to CSVs in automation data explorer PMs are 404s

In the data explorer ‘Allow groups to access this query’ is set to: moderators, admins, staff

In the Automation record ‘Attach the CSV file to the PM’ is ticked. The script is ‘Schedule a PM with Data explorer results’.

The recipients are an admin and a moderator - same result for both.

I’ve tried it with a couple of data explorer queries, ‘Inactive Users with no posts’ for instance. (The csv is available to download on the Data explorer page.)

The Discourse version installed is 3.4.0.beta3-dev (d7503a6153), the Data Explorer plugin is up to date (f2891947).

Automation setting for the ‘Inactive Users with no posts’ PM:

1 Like

Can you share the raw contents of one of these PMs sent by the automation? Feel free to PM me if it’s content not meant for a public audience.

This was due to the csv extension not being added to the authorized extensions for staff setting.

After adding the csv extension and retriggering a PM the csv link in the subsequent PM worked.

A couple of suggestions:

  1. On the automation pages, add some text and a link after the tickbox ‘Attach the CSV file to the PM’. Something like: (Requires authorization of csv extension). Linking ‘authorization of csv extension’ to /admin/site_settings/category/all_results?filter=authorized%20extensions%20for%20staff

  2. To help diagnose what the issue is in future instances, if possible, change the link in the PM when csv isn’t an authorized extension, from:
    href=“/404”
    to something like:
    href=“/unauthorized”

Thanks @pmusaraj for helping me with this one! :heart:

1 Like

Thank you for tracking it down to that site setting! It’s a sneaky one!

1 Like

I can’t do all your recommendations but from now when you save an automation using this script and attach_csv is checked, it will generate an error if csv is not in the list of authorized_extensions:

Screenshot 2024-12-09 at 17.09.14

Thanks for the report.

2 Likes

That’s great, thank you @joffreyjaffeux !

1 Like