Strange problem with Data Explorer

(Andrew Waugh) #1

I’m not sure if I’ve misunderstood something, or there is a problem with the plugin, or something bent in discourse.

As of last night we’re on the latest version of discourse beta, and the plugin was also first added last night. It works fine, except that any query which involves the declaration of an integer (in [params]) yields: an error message indicating “Parameter declaration error - the default value is not a valid int” whenever I try to save it.

(This is the case for all the examples on What cool data explorer queries have you come up with? which I have copy/pasted from meta (yes, I retyped the [params] section manually, just in case it was some issue with copy/paste adding weird characters).

Making launcher a bit more versatile
Data Explorer Plugin
(Jeff Atwood) #2

Can we repro this @techapj?

(Arpit Jalan) #3

I am unable to repro this error on master or beta branch. This query works perfectly fine on my local dev instance.


Can you screen shot the error with the parameters that you’re using? It’s possible to throw that error by entering invalid parameters (e.g. wrong date format, no parameter).

(Andrew Waugh) #5

Copy/paste of exactly the same query as Arpit just ran on his dev instance.


Sorry, I meant including the parameters that you’ve entered.

(Andrew Waugh) #7

Happens as soon as I hit Save, or Save and run.

Is it because I didn’t send my Ex MIL a Valentine’s card?


Are you entering parameters into the fields at the bottom before running the query? If not, that would cause that error.


Almost certainly, yes.

(Mittineague) #10

Check to make sure there isn’t an invisible whitespace character after the integer casting it to a string.

(Andrew Waugh) #11

That does not appear on my browser, neither edge (I know) nor Chrome.

Surely I need to save the query first? (That is when the error message is happening)


Weird. I’ve just recreated that query a couple of times and hitting save immediately creates the parameter input fields without throwing an error.

I’m out of ideas. :frowning:

(Andrew Waugh) #13

cue Twilightzone music…

I get exactly the same from two separate discourse installs, and I am admin on both. On both of them it is the same regardless of what browser I use. It happens with any explorer query which includes an int or integer in [params], but any other query works just fine.

One site is our live site, the other is a sandbox, which I installed with the cloud install, ubuntu 16.04, all updates etc, and restored a backup from the live site to. The only difference between the two is that on the sandbox I have some other plugins installed for testing.

The common plugins are:
Discourse Whos Online


@JagWaugh what version are you running?

I was able to replicate this on 1.7.2 stable version - I found the following gave me the issue:

-- int :min_posts = 1

if you change that to

-- int :min_posts

and save the query - you should then after filling in the 3 boxes (date_from, date_to and min_posts) be able to run it ok.

(Andrew Waugh) #15

We’re on
Live site: v1.8.0.beta5 +68
Sandbox: v1.8.0.beta5 +66

But when I remove the " = 1" I can save the query, the fields appear below, I can fill them in, and it runs fine on both the live and the sandbox.



So I cant tell you whats causing the issue but at least we have a workaround :smiley:

(Andrew Waugh) #17

The error message is immediate. I have trouble believing that this could be due to any form of database oddity in our site content.

I’ll have a look at the logs on the sandbox instance, then step through uninstalling the plugins one after another tomorrow. Sandbox site has no CSS or anything unusual.

(Andrew Waugh) #18

So, stepped removing the plugins one by one until only data explorer is the only one left. Still does exactly the same thing. No errors whatsoever in /logs. Nothing I can see in docker log|grep explorer, int.

Any clues?


@gerhard did a new fix for this., check it here.