Cloud Credentials error could not retrieve response

Truenas Scale 25.04.1
This has been upgraded through multiple truenas scale versions. Not sure when this started because i was not really using the cloud accounts for any important so did not watch it that close.

when I try to add one i get this error.

3 validation errors for CloudCredentialQueryResult result.list[CloudCredentialQueryResultItem].0.provider.GOOGLE_DRIVE.token Field required [type=missing, input_value={'type': 'GOOGLE_DRIVE'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.9/v/missing result.CloudCredentialQueryResultItem Input should be a valid dictionary or instance of CloudCredentialQueryResultItem [type=model_type, input_value=[{'id': 1, 'name': 'Googl...xtdms33wpzyhthjs6ti2'}}], input_type=list] For further information visit https://errors.pydantic.dev/2.9/v/model_type result.int Input should be a valid integer [type=int_type, input_value=[{'id': 1, 'name': 'Googl...xtdms33wpzyhthjs6ti2'}}], input_type=list] For further information visit https://errors.pydantic.dev/2.9/v/int_type

I’m fine with just deleting the accounts I just can not figure out how to do that.

I was able to fix the issue with a little help from some AI. Don’t know if this was the only way to fix it or not but seemed to work.

sqlite3 /data/freenas-v1.db ".backup /tmp/config_backup.db"
sqlite3 /data/freenas-v1.db "SELECT * FROM system_cloudcredentials;"

Then found the offending record that was mentioned in the error and ran this next. Update the ID= to the right ID. I actually deleted both from the database as the other one was obsolete.

 sqlite3 /data/freenas-v1.db "DELETE FROM system_cloudcredentials WHERE id=1;"
systemctl restart middlewared