Dashboard API error

Issue Summary

Hello community members,

When I try to call

http://redash.xyz.com/api/dashboards

I am getting below error

{
"message": "Internal Server Error"
}

Technical details:

looking into logs, I am getting below

[2021-08-31 12:26:37,580][PID:122587][ERROR][redash] Exception on /api/dashboards [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 477, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_login/utils.py", line 228, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/redash/redash.7.0.0.b17535/redash/handlers/base.py", line 31, in dispatch_request
    return super(BaseResource, self).dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_restful/__init__.py", line 587, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/redash/redash.7.0.0.b17535/redash/permissions.py", line 48, in decorated
    return fn(*args, **kwargs)
  File "/opt/redash/redash.7.0.0.b17535/redash/handlers/dashboards.py", line 75, in get
    serializer=serialize_dashboard,
  File "/opt/redash/redash.7.0.0.b17535/redash/handlers/base.py", line 108, in paginate
    items = [serializer(result) for result in results.items]
  File "/opt/redash/redash.7.0.0.b17535/redash/serializers.py", line 213, in serialize_dashboard
    'user': obj.user.to_dict(),
AttributeError: 'NoneType' object has no attribute 'to_dict'
  • Redash Version: 7
  • Browser/OS: Chrom
  • How did you install Redash: Legacy install

Is this a new installation of Redash? Has it ever worked?

This looks like an environment issue to me but there’s not enough data to say for sure.

not a new installation, it is there from couple of years. GUI is working fine but we never tried API. My intuition is that something is wrong with some dashboard which is stopping fetching all other dashboards.

Interesting thought! Do you see a 500 error when you page through your database list?

yes. till page=27 it is giving 500 but on page=28 is it giving “message”: “Page is out of range.”

made call to individual dashboards using “/api/dashboards/<dashboard_slug>” and all of them returning 200 :frowning:

found the cause. this issue is related to below

Thank you for linking that issue! I had totally forgotten about it. Since this isn’t a regression from V8 it won’t be fixed before the V10 release but we’ll see about arranging a fix after that.