Jump to content

AttributeError: xx object has no attribute...


Recommended Posts


I'm experiencing strange errors in our event handlers and actions. They are hard to replicate and sometimes restarting the event hub and the handlers works, but sometimes it doesn't.

I tried to get the thumbnail URL as described in the API docs (currently running 1.4.0) http://ftrack-python-api.rtd.ftrack.com/en/stable/example/thumbnail.html#example-thumbnail-url

When calling get_thumbnail_url, I get this error:

AttributeError: 'Location' object has no attribute 'get_thumbnail_url'

Printing the location object in fact prints this: <Location(3a372bde-05bc-11e4-8908-20c9d081909b)>

That's ftrack_api.symbol.SERVER_LOCATION_ID, but the type is just "Location". When I try the session.get("Location",...) line on another machine, this returns <ServerLocation...> and I can call get_thumbnail_url without problems.

I then tried to replace the session.get(...) with session.query("Location where id=...") and get_thumbnail_url with just get_url(). Now this exception is raised in ftrack's api:

  File "/path/to/site-packages/ftrack_api/entity/location.py", line 607, in get_url
    return self.accessor.get_url(resource_identifier)
AttributeError: 'Symbol' object has no attribute 'get_url'

The "Symbol object has not attribute xyz" has occured before when calling get_filesystem_path on an ftrack.unmanaged location:

File "/path/to/site-packages/ftrack_api/entity/location.py", line 583, in get_filesystem_path
    return self.get_filesystem_paths([component])[0]
File "/path/to/site-packages/ftrack_api/entity/location.py", line 592, in get_filesystem_paths
AttributeError: 'Symbol' object has no attribute 'get_filesystem_path'

What could be causing this?


Link to comment
Share on other sites

So if you just run this in a script on the problematic environment, you get "Location" rather than "ServerLocation"?

>>> import ftrack_api
>>> session = ftrack_api.Session()
>>> session.get('Location', ftrack_api.symbol.SERVER_LOCATION_ID)

If you try the same thing but make sure to empty your FTRACK_EVENT_PLUGIN_PATH environment variable?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...