AdhocWorker Issue redash.tasks.refresh_queries typeError | Kubernetes Self Hosted Redash

Issue Summary

A summary of the issue and the browser/OS environment in which it occurs.

Technical details:

  • Redash Version: 8.0.0+b32245, 8.0.2.b37747
  • Browser/OS: Chrome, MacOS Catalina
  • How did you install Redash: Via kubernetes contrib Helm Chart

I’m receiving the following error:

[2020-07-24 17:16:47,260][PID:25][INFO][Beat] Scheduler: Sending due task refresh_queries (redash.tasks.refresh_queries)

[2020-07-24 17:16:47,263][PID:6][INFO][MainProcess] Received task: redash.tasks.refresh_queries[66861e35-fa05-4164-9aa4-e0c0c1c76585]

[2020-07-24 17:16:47,264][PID:34][INFO][ForkPoolWorker-16] task_name=redash.tasks.refresh_queries task_id=66861e35-fa05-4164-9aa4-e0c0c1c76585 Refreshing queries…

[2020-07-24 17:16:47,299][PID:34][ERROR][ForkPoolWorker-16] Task redash.tasks.refresh_queries[66861e35-fa05-4164-9aa4-e0c0c1c76585] raised unexpected: TypeError(‘float() argument must be a string or a number’,)
Traceback (most recent call last):
File “/usr/local/lib/python2.7/site-packages/celery/app/trace.py”, line 385, in trace_task
**R = retval = fun(*args, kwargs)
query_text = query.parameterized.apply(parameters).query
File “/app/redash/models/parameterized_query.py”, line 125, in apply
invalid_parameter_names = [key for (key, value) in parameters.iteritems() if not self._valid(key, value)]
File “/app/redash/models/parameterized_query.py”, line 169, in _valid
return validate(value)
File “/app/redash/models/parameterized_query.py”, line 89, in _is_number
float(string)
TypeError: float() argument must be a string or a number

The actual deployment contains a database migrated from a self-hosted redash deployment running on a GCP VM with version 7.0.0.
If I change the env values for the adhocworker in the helmfile values the problem seems to be “solved” but of course it does not accomplish with the need.

I think this is the portion of helmfile which is giving this error but I don’t quite understand why it’s happening.

Hope someone can help me solving this error.

Did you run the database migrations to V8?

If your database was for V7 and now you’re running V8 without updating the schema you can see issues.

Hey, thanks for your quick answer, I did not do anything related to update the schema.
I did a pgdump of all my database running on the VM, Then, I restored it inside the postgres pod.
before that I’ve created the redash and redash_reader role in psql with the specific permissions.
I can see some dashboards but not all.
How can I update the schema properly? sorry but I don’t find any documentation or issue refering to this.

Thanks in Advice.

I think the problem is you took a database from V7 and tried running V8 on top of it. The database migrations happen when you upgrade from one version to another.

The desirable order of operations would be:

  1. Upgrade from V7 to V8
  2. pgdump your V7 database
  3. Spin up a new instance of V8
  4. Point this new instance at your data from step 2

K4s1m, I think I do that.

My old redash is running on an vm in v7 with a psql in the same vm, I don’t want to update this one, so I’ve created a new helmfile definition to deploy on my new gke cluster with all the requeriments I needed: (ha postgres, external redis, redash V8).
When I get this deployment running and working fine, I’ve stopped the V7 vm redash and then did a PG_DUMP (6gb) of the vm psql.
With that dump, I managed to get it into the cluster and at this point everything goes well.

Do you think I might need to update my old instance to v8 then pgdump all database and then transport that pgdump to the new cluster?

I think the problem relays on the python file and the adhocworker QUEUES variable, why do you think it is the migration?

An alternative version of the steps:

  1. pgdump your V7 database
  2. Spin up a copy of V7 in your new environment
  3. Load the output of step 1
  4. Upgrade in your new environment

I could be wrong :man_shrugging: But it’s good to rule out a bad migration as the cause since it is the source of many questions on the forum.

I understand, do you suggest to update my old v7 instance to v8 ?

K4s1m, I did the steps you mentioned.
I see the database is working very well, I have doubs about the upgrade to v8 in the new environment.
This new environment is running on kubernetes and deployed via helm, upgrading the image tag will be enough or there is anything that I could be missing?

I’m not familiar with kubernetes or helm :frowning:

Oh I see.
Okey then, I will open another thread.