Autodesk Forge Model Derivative API: TranslationWorker-InternalFailure - autodesk-model-derivative

I am attempting to translate an .rvt file to svf using the following call using the model derivative forge api. I am uploading a single rvt file and the file is not corrupt
POST /modelderivative/v2/designdata/job HTTP/1.1
Host: developer.api.autodesk.com
Authorization: Bearer
Content-Type: application/json; charset=utf-8
x-ads-force: true
Cache-Control: no-cache
Postman-Token: a05c2308-6b4f-7a3f-57b0-2916f25d0157
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2V0ZXN0c3AvV0lMRC5ydnQ=",
"compressedUrn": true,
"rootFilename": "WILD.rvt"
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": ["2d"]
}]
}
}
Here is the response I get. Not sure what is wrong. Please help
{
"type": "manifest",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2V0ZXN0c3AvV0lMRC5ydnQ",
"version": "1.0",
"derivatives": [
{
"name": "LMV Bubble",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"messages": [
{
"type": "error",
"message": "Tr worker fail to download.",
"code": "TranslationWorker-InternalFailure"
}
],
"outputType": "svf"
}
]
}

Since you translating a RVT and not an archive (ZIP) so remove the "compressedUrn": true, "rootFilename": "WILD.rvt" (which is for archives and their root files) bit from your job request payload:
{
"input": {
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2V0ZXN0c3AvV0lMRC5ydnQ="
},
"output": {
"destination": {
"region": "us"
},
"formats": [
{
"type": "svf",
"views": ["2d"]
}]
}
}

Related

Strapi: error when trying to update an entry 'entry.notFound'

I am trying to update some data for an entry in strapi. Everything was going fine and I was doing it correctly but suddenly I got this error.
{
"event": "didNotEditEntry",
"properties": {
"error": {
"response": {
"payload": {
"statusCode": 400,
"error": "Bad Request",
"message": [
{
"messages": [
{
"id": "entry.notFound",
"message": "entry.notFound"
}
]
}
],
"data": [
{
"messages": [
{
"id": "entry.notFound",
"message": "entry.notFound"
}
]
}
]
}
}
},
"status": "draft",
"projectType": "Community"
},
"uuid": "xxxxxxxx"
}
Does anyone know why I can't update the strapi console? I'm just updating one text for another.

Google GA4 batchRunReports when API doesn't have records throw 500 (Internal Server Error)

https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/TopLevel/batchRunReports
Request :
{
"entity": {
"propertyId": "XXXXXXXX"
},
"requests": [
{
"entity": {
"propertyId": "XXXXXXXX"
},
"dimensions": [
{
"name": "date"
},
{
"name": "dateHour"
},
{
"name": "firstUserCampaignName"
}
],
"metrics": [
{
"name": "sessions"
}
],
"dateRanges": [
{
"startDate": "2021-04-06",
"endDate": "2021-04-07"
}
],
"metricAggregations": [
"TOTAL"
],
"dimensionFilter": {
"andGroup": {
"expressions": [
{
"filter": {
"fieldName": "medium",
"stringFilter": {
"matchType": "EXACT",
"value": "Test"
}
}
}
]
}
},
"orderBys": [
{
"desc": true,
"metric": {
"metricName": "sessions"
}
},
{
"desc": false,
"dimension": {
"dimensionName": "dateHour"
}
}
],
"keepEmptyRows": true
}
]
}
Response:
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
But if remove following property from request:
"metricAggregations": [
"TOTAL"
],
I am able to see following response where there is not rows :
{
"reports": [
{
"metricHeaders": [
{
"name": "sessions",
"type": "TYPE_INTEGER"
}
],
"metadata": {},
"dimensionHeaders": [
{
"name": "date"
},
{
"name": "dateHour"
},
{
"name": "firstUserCampaignName"
}
],
"kind": "analyticsData#runReport"
}
],
"kind": "analyticsData#batchRunReports"
}
Any idea how to prevent 500 internal server error in this case ?
This error block google API call for an hour.
Furqan, there seems to be an issue with the Data API where a call using metricAggregations is failing in case the generated report is empty. In the meantime, to workaround this error, you can modify a query so that the resulting report contains more than 0 rows.

ARM Template unable to set $connections

I have created an ARM template in Visual Studio project with connection to slack. When I connect to slack in Azure portal - everything is fine. My slack API connection is authorized and works. My problem is with deployment and setting $connections.
Here is my template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
<template-params>
},
"variables": {
"slack": "[concat(parameters('appPrefix'), '-slack-', parameters('environment'))]"
},
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"location": "[resourceGroup().location]",
"name": "[variables('slack')]",
"properties": {
"api": {
"id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/slack')]"
},
"displayName": "Slack",
"parameterValues": {}
}
},
{
"name": "[parameters('logicAppName')]",
"type": "Microsoft.Logic/workflows",
"location": "[parameters('logicAppLocation')]",
"tags": {
"displayName": "LogicApp"
},
"apiVersion": "2016-06-01",
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Collecting_went_wrong": {
"inputs": {
"host": {
"connection": {
"name": "#parameters('$connections')['slack']['connectionId']"
}
},
"method": "post",
"path": "/chat.postMessage",
"queries": {
"channel": "<channel>",
"text": "<message>",
"username": "<user>"
}
},
"runAfter": {},
"type": "ApiConnection"
}
},
"parameters": {
"$connections": {
"type": "object",
"defaultValue": {
}
}
},
"triggers": {
<trigger>
}
},
"parameters": {
"$connections": {
"value": {
"slack": {
"id": "[resourceId('Microsoft.Web/connections', variables('slack'))]",
"connectionId": "[resourceId('Microsoft.Web/connections', variables('slack'))]",
"connectionName": "slack"
}
}
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/connections', variables('slack'))]"
]
}
],
"outputs": {}
}
The 'fun' part is validation of template during the deployment:
New-AzureRmResourceGroupDeployment : 17:08:51 - Resource Microsoft.Logic/workflows 'reporting-reminder-logic-app-dev'
failed with message '{
"error": {
"code": "ConnectionsParameterInvalid",
"message": "The provided API connection parameter 'slack' is missing the required property 'id'."
}
}'
I'm really confused here.
What I tried to deploy it as connection and added $connection parameter definition as well, deployment went through. Nevertheless, when I changed connection to $connections in template parameters, Azure portal throw at me the same validation error.
Any idea what am I doing wrong here?
Thanks
The issue was about different ID in resources -> Microsoft/Web.connections -> properties -> id and slack -> connection. Once this connection ids were the same, the validation passed.
So it's only confusing validation message.

Customizing the Oracle ORDS generated Swagger documentation

I'm writing a REST-API using Oracle ORDS.
ORDS generates a Swagger 2.0 API documentation on a predefined URL.
I can not find how to add custom information like a text for the endpoint description or the name and schema for the "object" returned from the endpoint.
Does anyone here know how to adjust the ORDS generated Swagger documentation?
We recently enhanced ORDS such that you could inject custom comments into the Swagger-style OpenAPI Docs.
New Features in 18.4.0
ENH:28028432 - Echo p_comments value into generated Swagger
documentation Earlier versions
Here's an example -
Defining my POST
BEGIN
ORDS.DEFINE_HANDLER(
p_module_name => 'EXAMPLES',
p_pattern => 'id/',
p_method => 'POST',
p_source_type => 'plsql/block',
p_items_per_page => 0,
p_mimes_allowed => 'application/json',
p_comments => 'This is a bad example, has no error handling',
p_source =>
'begin
insert into identity_table (words) values (:words);
commit;
end;'
);
COMMIT;
END;
/
Now if I go to the OpenAPI endpoint for my module, you can see the Description text for the handler has been 'injected' into the service documentation.
"This is a bad example, has no error handling" -- it's a free text field, so you can basically put anything you want there.
{
"swagger": "2.0",
"info": {
"title": "ORDS generated API for EXAMPLES",
"version": "1.0.0"
},
"host": "localhost:8080",
"basePath": "/ords/pdb2/jeff/examples",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"paths": {
"/id/": {
"get": {
"description": "Retrieve records from EXAMPLES",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "The queried record.",
"schema": {
"type": "object",
"properties": {
"ID": {
"$ref": "#/definitions/NUMBER"
},
"WORDS": {
"$ref": "#/definitions/VARCHAR2"
}
}
}
}
},
"parameters": []
},
"post": {
"description": "This is a bad example, has no error handling",
"responses": {
"201": {
"description": "The successfully created record.",
"schema": {
"type": "object",
"properties": {}
}
}
},
"consumes": [
"application/json"
],
"parameters": [
{
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/EXAMPLES_ITEM"
}
}
]
}
},
"/id/{pk}": {
"get": {
"description": "Retrieve records from EXAMPLES",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "The queried record.",
"schema": {
"type": "object",
"properties": {
"ID": {
"$ref": "#/definitions/NUMBER"
},
"WORDS": {
"$ref": "#/definitions/VARCHAR2"
}
}
}
}
},
"parameters": [
{
"name": "pk",
"in": "path",
"required": true,
"type": "string",
"description": "implicit",
"pattern": "^[^/]+$"
}
]
}
}
},
"definitions": {
"NUMBER": {
"type": "number"
},
"VARCHAR2": {
"type": "string"
},
"EXAMPLES_ITEM": {
"properties": {
"words": {
"type": "string"
}
}
}
}
}

Firefox webExtension - re-write "redirectURL" in HTTP POST response

I'm writing my first webExtension for Firefox. It targets a particular feature on one website, and essentially needs to rewrite the "redirectURL" value in the server response to a HTTP POST (I want it to stop refreshing the page after certain buttons are clicked).
I'm having trouble with this. So far, I've tried webRequest.onHeadersReceived, but the "redirectURL" value isn't in the headers. I've also tried a filterResponseData, but "redirectURL" value isn't in the content of the response either. I captured the full transaction using browser dev tools, and here is the relevant part:
"response": {
"status": 302,
"statusText": "Found",
"httpVersion": "HTTP/2.0",
"headers": [
{
"name": "date",
"value": "Fri, 05 Jul 2019 13:06:18 GMT"
},
{
"name": "content-type",
"value": "text/html; charset=utf-8"
},
{
"name": "location",
"value": "https://www.strava.com/clubs/2140/members"
},
{
"name": "cache-control",
"value": "no-cache, no-store"
},
{
"name": "via",
"value": "1.1 linkerd"
},
{
"name": "x-download-options",
"value": "noopen"
},
{
"name": "pragma",
"value": "no-cache"
},
{
"name": "status",
"value": "302 Found"
},
{
"name": "expires",
"value": "Sat, 01 Jan 2000 00:00:00 GMT"
},
{
"name": "x-request-id",
"value": "5ff9a2b9-e9b4-453e-9e4e-d42e1ffdd09c"
},
{
"name": "referrer-policy",
"value": "strict-origin-when-cross-origin"
},
{
"name": "x-frame-options",
"value": "SAMEORIGIN,DENY"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "x-permitted-cross-domain-policies",
"value": "none"
},
{
"name": "x-xss-protection",
"value": "1; mode=block"
},
{
"name": "content-encoding",
"value": "gzip"
},
{
"name": "X-Firefox-Spdy",
"value": "h2"
}
],
"cookies": [],
"content": {
"mimeType": "text/html; charset=utf-8",
"size": 119109,
"comment": "Response bodies are not included."
},
"redirectURL": "https://www.strava.com/clubs/1234/members", <-- I want to re-write this
"headersSize": 597,
"bodySize": 29832
},
Thanks in advance!
The redirect URL is in the location header. The line you marked in the HAR is merely an indication of the action the browser took.
So you can intercept the response and change said header:
function modifyRedir(details)
{
for (let header of details.responseHeaders) {
if (header.name.toLowerCase() == "location")
{
header.value = "<some URL>";
}
}
return {responseHeaders: details.responseHeaders};
}
browser.webRequest.onHeadersReceived.addListener(
modifyRedir,
{
urls: ["<URL this should be applied to>"]
},
["blocking", "responseHeaders"]
);
Alternatively, you could also just overwrite the redirect
function modifyRedir(details)
{
return {redirectUrl: "<some URL>"};
}

Resources