petrbroz / svf-utils

Utilities for working with the SVF file format used by Autodesk Platform Services.
https://petrbroz.github.io/svf-utils/
MIT License
126 stars 54 forks source link

getDerivativeUrl Request failed with status : 500 and statusText : Internal Server Error and error message: undefined #84

Closed iFieldSmart-Tech closed 5 days ago

iFieldSmart-Tech commented 2 weeks ago

I installed the utility using the command line. I set the client id and secret as directed in the readme. I tried on a few different URN's, but i get the same error for every model URN,

info: 27-08-2024 20:06:06:      Initializing resiliency config:  ResiliencyConfiguration (TimeOutValue: 15000) RetryCount: 5) (BackoffInterval: 10)  (CircuitBreakerInterval: 60000)
info: 27-08-2024 20:06:06:      Entered into fetchToken
info: 27-08-2024 20:06:06:      fetchToken Request completed successfully with status code: 200
info: 27-08-2024 20:06:07:      Entered into getManifest
info: 27-08-2024 20:06:07:      getManifest Request completed successfully with status code: 200
info: 27-08-2024 20:06:07:      Entered into fetchToken
info: 27-08-2024 20:06:08:      fetchToken Request completed successfully with status code: 200
info: 27-08-2024 20:06:08:      Entered into getDerivativeUrl
info: 27-08-2024 20:06:08:      getDerivativeUrl Request completed successfully with status code: 200
Reading fragments...
info: 27-08-2024 20:06:10:      Entered into fetchToken
info: 27-08-2024 20:06:10:      fetchToken Request completed successfully with status code: 200
info: 27-08-2024 20:06:10:      Entered into getDerivativeUrl
error: 27-08-2024 20:06:11:     getDerivativeUrl Request failed with status : 500 and statusText : Internal Server Error and error message: undefined
ModelDerivativeApiError: getDerivativeUrl Request failed with status : 500 and error message: undefined
kylefoley commented 2 weeks ago

You might wanna edit this and remove your Bearer token, since it doesn't expire for another 30 mins

lancelu-eri commented 2 weeks ago

I've been running into this issue too. When I use the Autodesk Platform Services extension in VSCode the same thing happens as well: "Could not convert derivatives: getDerivativeUrl Request failed with status : 500 and error message"

kylefoley commented 2 weeks ago

Please don't download that

iFieldSmart-Tech commented 2 weeks ago

You might wanna edit this and remove your Bearer token, since it doesn't expire for another 30 mins

Oops! Too late for that now 😥 Thank you for noticing though, i will keep it in mind next time i post :)

iFieldSmart-Tech commented 1 week ago

??? Anybody able to get past that error?

kylefoley commented 1 week ago

Try reuploading the model. I've had this error a few times and it seems to be model specific

iFieldSmart-Tech commented 1 week ago

But it is not for one specific model only. I tried with 4-5 different models. And those models open fine in the forge viewer

petrbroz commented 6 days ago

Thanks for the heads up, everyone. Nothing has changed on the svf-utils side so I'll need to investigate if there could potentially be some regression on the Model Derivative service side.

And yes, please do not paste the entire error log as it might contain sensitive information (such as access tokens). I'll add a task to my backlog to clean up the error logs a bit.

petrbroz commented 6 days ago

I've tested the feature with a couple of SVF designs, and I can't reproduce the issue :/ Could you please provide more details about the issues you see?

It would also be helpful if you could share some of the problematic designs with us via aps.help@autodesk.com (confidentially - the data would only be used for internal debugging).

petrbroz commented 6 days ago

One theory I have is: looking at the error logs, I see several occurrences of %255C in the URL. URL-decoding that yields %5C, and URL-decoding that in turn yields \. So I'm wondering if there could be an issue with "doubled encoding" in certain cases (when the derivative URN includes backslashes).

lance-lu-elder commented 6 days ago

Hi Petr, I've been using the rac_basic_sample_project.rvt https://help.autodesk.com/view/RVT/2024/ENU/?guid=GUID-61EF2F22-3A1F-4317-B925-1E85F138BE88. I've done the conversion to SVF using both platform service calls and the VSCode extension both with the same results. I've only tested this on recently uploaded and converted designs.

lance-lu-elder commented 6 days ago

This is the error log I get when I use the sample/download-svf.js. There seems to be issues fetching the object attributes and files that aren't seen in the manifest.

C:\XXX>node samples/download-svf.js <model_urn>
info: 10-09-2024 09:19:30:      Initializing resiliency config:  ResiliencyConfiguration (TimeOutValue: 15000) RetryCount: 5) (BackoffInterval: 10)  (CircuitBreakerInterval: 60000)
info: 10-09-2024 09:19:30:      Initializing resiliency config:  ResiliencyConfiguration (TimeOutValue: 15000) RetryCount: 5) (BackoffInterval: 10)  (CircuitBreakerInterval: 60000)
Downloading derivative dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6cnZ0X3RvX3N2Zl90cmFuc2Zvcm0vcmFjYmFzaWNzYW1wbGVwcm9qZWN0LnJ2dA
info: 10-09-2024 09:19:30:      Entered into fetchToken
info: 10-09-2024 09:19:31:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:31:      Entered into getManifest
info: 10-09-2024 09:19:31:      getManifest Request completed successfully with status code: 200
Downloading viewable 6bfb4886-f2ee-9ccb-8db0-c5c170220c40
info: 10-09-2024 09:19:31:      Entered into fetchToken
info: 10-09-2024 09:19:31:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:31:      Entered into getDerivativeUrl
info: 10-09-2024 09:19:31:      getDerivativeUrl Request completed successfully with status code: 200
info: 10-09-2024 09:19:32:      Initializing resiliency config:  ResiliencyConfiguration (TimeOutValue: 15000) RetryCount: 5) (BackoffInterval: 10)  (CircuitBreakerInterval: 60000)
info: 10-09-2024 09:19:32:      Entered into fetchToken
info: 10-09-2024 09:19:33:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:33:      Entered into getManifest
info: 10-09-2024 09:19:34:      getManifest Request completed successfully with status code: 200
info: 10-09-2024 09:19:34:      Entered into fetchToken
info: 10-09-2024 09:19:34:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:34:      Entered into getDerivativeUrl
info: 10-09-2024 09:19:34:      getDerivativeUrl Request completed successfully with status code: 200
Downloading asset ../../objects_attrs.json.gz
info: 10-09-2024 09:19:34:      Entered into fetchToken
info: 10-09-2024 09:19:34:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:34:      Entered into getDerivativeUrl
error: 10-09-2024 09:19:34:     getDerivativeUrl Request failed with status : 401 and statusText : Unauthorized and error message: undefined
Could not download asset ../../objects_attrs.json.gz
Downloading asset ../../objects_vals.json.gz
info: 10-09-2024 09:19:34:      Entered into fetchToken
info: 10-09-2024 09:19:35:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:35:      Entered into getDerivativeUrl
error: 10-09-2024 09:19:35:     getDerivativeUrl Request failed with status : 500 and statusText : Internal Server Error and error message: undefined
Could not download asset ../../objects_vals.json.gz
Downloading asset ../../objects_ids.json.gz
info: 10-09-2024 09:19:35:      Entered into fetchToken
info: 10-09-2024 09:19:35:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:35:      Entered into getDerivativeUrl
error: 10-09-2024 09:19:35:     getDerivativeUrl Request failed with status : 500 and statusText : Internal Server Error and error message: undefined
Could not download asset ../../objects_ids.json.gz
Downloading asset ../../objects_viewables.json.gz
info: 10-09-2024 09:19:35:      Entered into fetchToken
info: 10-09-2024 09:19:35:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:35:      Entered into getDerivativeUrl
error: 10-09-2024 09:19:36:     getDerivativeUrl Request failed with status : 401 and statusText : Unauthorized and error message: undefined
Could not download asset ../../objects_viewables.json.gz
Downloading asset ../../objects_offs.json.gz
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
error: 10-09-2024 09:19:36:     getDerivativeUrl Request failed with status : 500 and statusText : Internal Server Error and error message: undefined
Could not download asset ../../objects_offs.json.gz
Downloading asset ../../objects_avs.json.gz
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
Could not download asset ../../objects_avs.json.gz
Downloading asset Materials.json.gz
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
Could not download asset Materials.json.gz
Downloading asset CameraDefinitions.bin
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
Could not download asset CameraDefinitions.bin
Downloading asset LightDefinitions.bin
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
Could not download asset LightDefinitions.bin
Downloading asset 0.pf
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:36:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:36:      Entered into getDerivativeUrl
Could not download asset 0.pf
Downloading asset 1.pf
info: 10-09-2024 09:19:36:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 1.pf
Downloading asset 2.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 2.pf
Downloading asset 3.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 3.pf
Downloading asset 4.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 4.pf
Downloading asset 5.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 5.pf
Downloading asset 6.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset 6.pf
Downloading asset GeometryMetadata.pf
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset GeometryMetadata.pf
Downloading asset FragmentList.pack
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:37:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:37:      Entered into getDerivativeUrl
Could not download asset FragmentList.pack
Downloading asset CameraList.bin
info: 10-09-2024 09:19:37:      Entered into fetchToken
info: 10-09-2024 09:19:38:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:38:      Entered into getDerivativeUrl
Could not download asset CameraList.bin
Downloading asset LightList.bin
info: 10-09-2024 09:19:38:      Entered into fetchToken
info: 10-09-2024 09:19:38:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:38:      Entered into getDerivativeUrl
Could not download asset LightList.bin
Downloading asset InstanceTree.bin
info: 10-09-2024 09:19:38:      Entered into fetchToken
info: 10-09-2024 09:19:38:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:38:      Entered into getDerivativeUrl
Could not download asset InstanceTree.bin
Downloading asset Set.bin
info: 10-09-2024 09:19:38:      Entered into fetchToken
info: 10-09-2024 09:19:38:      fetchToken Request completed successfully with status code: 200
info: 10-09-2024 09:19:38:      Entered into getDerivativeUrl
Could not download asset Set.bin
petrbroz commented 6 days ago

Thanks @lance-lu-elder. I've just tried the exact same Revit file but still no luck reproducing the issue :/ Btw to rule out any potential issues on the APS SDK side, could you please upgrade to the latest version of svf-utils that I've just released (5.0.4), and see if you can still reproduce the issue?

lance-lu-elder commented 6 days ago

@petrbroz I've upgraded to 5.0.4 and the issue persists :/ I've tried with a few other revit files and run into the same issue. I see the funky encoding on my error logs as well, but I'm not sure how to troubleshoot that.

I'm on Windows 11 btw

lancelu-eri commented 6 days ago

Just tried this on a unix container and it worked. Not sure if that helps with troubleshooting.

petrbroz commented 5 days ago

Thanks folks, I've been suspecting this could be related to Windows specifically. Let me test the SVF download on my desktop Windows PC tomorrow morning, and report back here.

iFieldSmart-Tech commented 3 days ago

Hi @petrbroz did you get a chance to try it out on a windows pc? Is it confirmed to be windows specific only?

petrbroz commented 3 days ago

@iFieldSmart-Tech, yep, I've confirmed that this was an OS-specific bug (had to replace path.join(...) with path.posix.join(...) when resolving the URLs of assets referenced by the SVF manifest. And I've confirmed that - with the fix in place - the SVF download on Windows now works as expected.

petrbroz commented 3 days ago

If you're still having issues with the SVF download, please create a new GitHub issue.

iFieldSmart-Tech commented 3 days ago

My Bad, i was trying with my current version. After upgrading to the latest version it worked correctly. Sorry. And thank you!