Component path shows up red
1 1

27 posts in this topic

Hello,

I just attached a file as a component to a version but it shows up red in the browser. I did some googling and found this thread:

forum.ftrack.com/topic/167-location-path-is-red/

But it doesn't solve my problem.

The structure I used can be reproduced using: (Sorry the real code is inside intranet I have no way to bring it out):

class ConfigurationiStructure(StandardStructure):
  def _get_parts(self, component):
    return ['play', 'asset_a', 'v003']

And the way I'm using the structure is,

location.structure = ConfigurationStructure()
version.create_component(
  r'd:\test_upload.jpg',
  {'name': 'ftrackreview-image'},
  location=location
)

Also I noticed that when I click Review button in the component, the review page shows up but with an error "A server error occurred. Please try again or contact support.” and it fails to load any media.

Any help would be appreciated

Share this post


Link to post
Share on other sites

It's worth mentioning that the path is 100% available by "location.get_component_availability()" even though it's red.

Share this post


Link to post
Share on other sites

Hi @John Su, the path is resolved through an event available in ftrack_connect itself and called resolve.py
If the path is red is possible that your structure cannot be properly initialised and hence not be resolved.
You can try adding more logs into the resolve.py and see if anything is off.
Please send us , either here or through support (depending on how sensible the information are) and we'll look further into it.
Hope it helps.
Cheers.

L.

Share this post


Link to post
Share on other sites

Thanks Lorenzo, it works after launching ftrack connect(don't know it has to be with connect before).

Is there anyway I can get it work without ftrack-connect? We've wrapped all the publish/actions launcher entrace so except for this we don't need ftrack-connect. It would be great if there's a way we can do it without ftrack-connect. Cheers.

Share this post


Link to post
Share on other sites

Hi @John Su, sure you can ! 
just extract the given script (or download it directly from here ) and drop it in a folder mapped in a  FTRACK_EVENT_PLUGIN_PATH environment variable.
When the session start will look into that variable to see if there's any plugin to be discovered and run.
I'd suggest having one folder on a shared server folder mapped so you can simply drop events in there.

Hope it helps.
If you need any further help just let us know !
L.

Share this post


Link to post
Share on other sites

Hi Lorenzo it's correctly resolved for now but I have 2 questions:

1. It seems that the resolver.py under ftrack-connect installation directory is not found by ftrack web. It works as expected after I put it under $FTRACK_EVENT_PLUGIN_PATH. Is this a normal behaviour?

2. Now It works with the help of ftrack-connect. Without it the local session is fine but I failed to get it found by ftrack web. Any suggestion?

Thank you.

Share this post


Link to post
Share on other sites

Hi @John Su, you don't need to have ftrack connect running to have actions and events.
You can run them as simple python scripts (as long as they can access the ftrack-python-api).

1) no it should jut work 

2) In here you can find many examples on how to run events and actions as standalone.
Hope it helps.
L.

Share this post


Link to post
Share on other sites

@John Su if you want this to be working for everyone, $FTRACK_EVENT_PLUGIN_PATH  should be set on each machine , and should be pointing to a shared folder on the network path.   If on the other hand you just want to test it by yourself you can drop it in the local plugin folders under a hook folder (please note this applies also on the shared one).

If you are still having issues please let us know and we'll try to further help you out.

Cheers.

L.

 

ps.

Best of course is to extend the environment and not to replace it , so something like:

FTRACK_EVENT_PLUGIN_PATH=$FTRACK_EVENT_PLUGIN_PATH:/your/central/path

 

Share this post


Link to post
Share on other sites

Sorry I have to bother you again. Because it still doesn't work, nor did I get the logic.

Could you talk a little bit more detail about how the component path in ftrack web page get resolved by script under $FTRACK_EVENT_PLUGIN_PATH? I think that's the part confused me most. 

ftrack web page is displayed in web browser, the browser might know the environment variable but how does the script get involved?( there's even no python interpreter on the machine that's running the web browser).

Share this post


Link to post
Share on other sites

Hi @John Su, you can find some more information about the plugin ftrack environment paths here
Overall though the env does not have to be known by the server as is up to the session object to discover it and put it to the use.

The resolve scripts uses the ftrack events to notify the server about the resolved path of the component .
ftrack event system is quite powerful and I'd suggest digging deeper looking in here.
You can also find more examples on how to use events in our recipes repository.


Hope it helps.
L.

Share this post


Link to post
Share on other sites

The environment variables can affect the local python created session object. But isn't the session that generate the web page on server end? So locally setting ftrack variables won't affect the web page. Is it right?

Or did I misuse the word "web"? Just to be clear I mean the ftrack web page interface, not through customized python client.

Share this post


Link to post
Share on other sites

The environment variable will tell the session object where to pick up its plugins (the resolve in this case).
The resolve will then submit to the server the information on how to represent the component path through the event I've been linking you previously.
Hope it makes more sense this way.
L.

Share this post


Link to post
Share on other sites

In regards to "The environment variable will tell the session object where to pick up its plugins (the resolve in this case)."  does the specific "session object" live in browser? Because it definitely doesn't start locally in any python intepreter as one can browse ftrack web without python installed.

Share this post


Link to post
Share on other sites

So how does the environment variable affect the way the session object picks up its plugins? Environment variables can only affect local sessions as far as I know. But there's no local sessions in the case that the web browser is the only thing a use has, right?

Share this post


Link to post
Share on other sites

Hi @John Su ,

The web browser obviously does not know nothing about your local environment variables.

These are used only from ftrack session (ftrack-python-api) and ftrack connect to discover their plugins.
The resolution server side is done through the ftrack event system which will instruct the server (through the socket) on how to handle the final path rendered in the ui.

Hope it helps.
L.

Share this post


Link to post
Share on other sites

Hi Lorenzo, thanks for you patience.

" ftrack event system" is a bit confusing to me.. (I know in ftrack-python-api the sesion object can publish event and register handler, but in this case ftrack-python-api doesn't get chance to do the work)

Is it the ftrack web page gets the envionment variable and transmits it to the resolution server?

Share this post


Link to post
Share on other sites

Hi @John Su

the environment variables (guess we are still referring to FTRACK_EVENT_PLUGIN_PATH ) is only handled locally by the session object of the api, and does have nothing to do with the path resolution itself.
This environment variable will tell the local event hub where to pick the plugins from.
One of this plugin is the resolved which , once loaded, will respond to an event emitted from the server, returning the resolved path.

>> but in this case ftrack-python-api doesn't get chance to do the work

I'm not sure I'm getting this.... 
The ftrack-python-api (session) are used as part of the resolved itself, to return the resolved path to the server.
https://bitbucket.org/ftrack/ftrack-connect/src/80850248fc57c232fa6267bfdeb87f3d3427b706/resource/hook/resolver.py#lines-30
 

If you need more information on how the session and the event hub works I'd suggest digging into our docs :
http://ftrack-python-api.rtd.ftrack.com/en/stable/handling_events.html

 

L.

Share this post


Link to post
Share on other sites

 

On 6/17/2019 at 11:33 AM, John Su said:

Thanks Lorenzo, it works after launching ftrack connect(don't know it has to be with connect before).

Is there anyway I can get it work without ftrack-connect? We've wrapped all the publish/actions launcher entrace so except for this we don't need ftrack-connect. It would be great if there's a way we can do it without ftrack-connect. Cheers.

On 6/18/2019 at 8:16 PM, Lorenzo Angeli said:

Hi @John Su, sure you can ! 
just extract the given script (or download it directly from here ) and drop it in a folder mapped in a  FTRACK_EVENT_PLUGIN_PATH environment variable.
When the session start will look into that variable to see if there's any plugin to be discovered and run.
I'd suggest having one folder on a shared server folder mapped so you can simply drop events in there.

Hope it helps.
If you need any further help just let us know !
L.

I thought we are talking about using FTRACK_EVENT_PLUGIN_PATH without ftrack-connect. How does ftrack-python-api get chance to handle the environment variable if there's no ftrack-connect?

Share this post


Link to post
Share on other sites

Hi, @Lorenzo,

Yes I read that before. Unfortunately it doesn't answer my question.

Here are what I got so far:

  • The correctness of path resolution relies on resolve.py: Clear ✔️.
  • A customized resolve.py can be picked up by ftrack python api if I set FTRACK_EVENT_PLUGIN_PATH: Clear ✔️.

But here's the confusing bit:

  • The environment is needed here is because we want ftrack-web to resolve the path correctly. I can write a tool using ftrack python api and I'm sure the environment variable will work like you said, but the path shown on the web is still RED. So the real question is, is it possible to let a costumized resolve.py picked by ftrack-web like ftrack-connect does 

Anyway it's kind of fine if it's impossible.

 

Share this post


Link to post
Share on other sites

Hi John,

The path you'd like resolved, where is that file stored? resolve.py (really, a connected API session subscribed to the ftrack.location.request-resolve topic) could be running anywhere. The reason we let Connect handle it by default, and presumably why Lorenzo assumes you're running it on each artists' workstation is that it's possible that the mounts or file paths are different on each workstation. If you're saving to a common location and can assume the path for each person, you could just have one central API session listening to the event and serving up the response.

 

Does that clear up anything? You said you had a tool running, but that it was still failing to resolve in the web UI? Did you confirm you were receiving events? And responding appropriately?

Share this post


Link to post
Share on other sites

If I register and publish events using python api I can get the correct results. I didn't get any problem with that.

 

And about FTRACK_EVENT_PLUGIN_PATH, here's what I tested:

With Connect, Without FTRACK_EVENT_PLUGIN_PATH:

Component Path correctly resolved. Custom resolver.py not picked up.(which is correct) 

With Connect, With FTRACK_EVENT_PLUGIN_PATH:

Component Path correctly resolved. Custom resolver.py correctly picked up.

No Connect, Without FTRACK_EVENT_PLUGIN_PATH:

Component Path RED. Custom resolver.py NOT picked up.

No Connect, With FTRACK_EVENT_PLUGIN_PATH:

Component Path RED. Custom resolver.py NOT picked up.

 

So the question remains: how to get the component path resolved correctly without connect? (And again it's kind of fine if it not feasible)

I hope by this way I have what I'm trying to express expressed clearly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1