https://prefect.io logo
#prefect-community
Title
# prefect-community
d

Dmitriy

09/09/2019, 4:46 PM
Has anyone seen a
ValueError('Could not deserialize key data.')
when trying to create a BQ table with
CreateBigQueryTable
task? I've got my credentials in a
GOOGLE_APPLICATION_CREDENTIALS
environment variable as a JSON string and my
~/.prefect/config.toml
as:
Copy code
[cloud]
use_local_secrets = true
[context.secrets]
GOOGLE_APPLICATION_CREDENTIALS = "$GOOGLE_APPLICATION_CREDENTIALS"
I'm not passing anything for
credentials
to the task itself (since it already defaults to
GOOGLE_APPLICATION_CREDENTIALS
). I'm using Python 3.7.4 and
prefect==0.6.1
. Below is the exact output.
Copy code
[2019-09-09 16:42:23,995] INFO - prefect.TaskRunner | Task 'Create Table': Starting task run...
[2019-09-09 16:42:23,996] INFO - prefect.TaskRunner | Unexpected error: ValueError('Could not deserialize key data.')
[2019-09-09 16:42:23,996] INFO - prefect.TaskRunner | Task 'Create Table': finished task run for task with final state: 'Failed'
If anyone has any suggestions it's much appreciated.
c

Chris White

09/09/2019, 5:05 PM
Hey @Dmitriy! I’ve seen this before; it usually means that your secret in context isn’t being parsed correctly, usually caused by
\\n
newline values in the JSON blob
what I’ve done is call
json.dumps(my_credentials_dictionary)
and paste that exact value in for my secret, and it usually solves it
d

Dmitriy

09/09/2019, 5:41 PM
Good call about the newlines; only thing is that
json.dumps()
adds escapes and is what appears to be creating the
\\n
in the blob. What I did was pasted the blob into a text file, replaced
\\n
with
\n
and pasted that value into my secret and it worked! Thank you for the quick response.
c

Chris White

09/09/2019, 5:44 PM
@Marvin archive “`Could not deserialize key data`error on Google Tasks”
c

Chris White

09/09/2019, 5:44 PM
no problem - anytime!