We are creating a public link of an asset through an action script whenever an asset is modified.
The format of the public link is "Content hub domain/CDN name" + "Rendition name" + "Filename"
which means Public URL is generated based on the filename.
Note: If there is already a filename with a public URL then the second instance of same filename will not be able to generate a public URL, which is fine but in some cases, we had to delete the old image and replace it with the updated correct image, in that case also Content hub
is giving error while creating a public link.
The specified target is invalid. Exception:
Stylelabs.Scripting.Exceptions.RuntimeException: The script execution
failed in runtime - The specified target is invalid. --->
Stylelabs.M.Sdk.Exceptions.ValidationException: The specified target
is invalid. Failures: Property: 'RelativeUrl'.: ‘{RelativeUrl}’
already exists Stack trace: at
Stylelabs.M.Sdk.ScriptClient.Clients.EntitiesClient.SaveAsync(IEntity
entity) in
/src/Stylelabs.M.Sdk.ScriptClient/Clients/EntitiesClient.cs:line 176
at Submission#0.<CreateForRendition>d__15.MoveNext() in :line 195 ---
End of stack trace from previous location where exception was thrown
--- at Submission#0.<<Initialize>>d__0.MoveNext() in :line 66 --- End of stack trace from previous location where exception was thrown ---
at
Stylelabs.Scripting.Engines.CSScript.Persistence.<>c__DisplayClass10_0`1.<<Load>b__0>d.MoveNext()
in /src/Stylelabs.Scripting/Engines/CSScript/Persistence.cs:line 222
--- End of stack trace from previous location where exception was thrown --- at Stylelabs.Scripting.Script`1.Run(Object
globalScopeObject) in /src/Stylelabs.Scripting/Script.cs:line 255 ---
End of inner exception stack trace --- at
Stylelabs.Scripting.Script`1.Run(Object globalScopeObject) in
/src/Stylelabs.Scripting/Script.cs:line 259 at
Stylelabs.M.Base.Scripting.Base.ScriptSubCacheBase.Execute(CachedScript`1
script, Func`4 scopeHandler, Func`4 resultHandler) in
/src/Stylelabs.M.Base/Scripting/Base/ScriptSubCacheBase.cs:line 469
However, when we try to browse the existing URL, we get a 404 error. Is there any cache thing in content hub which prevents content hub to create a public link for that asset?
Update : Added error in text format, so that it will be useful for SEO.