I am trying to run a Revit plugin on Design Automation. Workitem fails with failedInstructions error. In the logs I can find "Error details: The system cannot find the file specified." Does that refer to the Revit file? Or the AppBundle? The input file is from BIM 360, the workitem contains a link and the header to download the Revit file and it seems like there are no issues there. I have also debugged the plugin locally using DesignAutomationHandler and that seems to work fine. Not sure what's missing.
[05/20/2022 20:39:12] Job information:
"CommandLine":[
"\"$(engine.path)/revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[Revit2ProtoExporter].path)\""
]
"Settings":{
"dasreportfaileduploadoptional": {
"value": "true",
"isEnvironmentVariable": true
}
}
"Id":"bc24e48e8f7548fe9262db12a7556055"
"ActivityId":"WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporterActivity+OV"
"Engine.Id":"Autodesk.Revit_2022!84"
"Apps": [
"App.Id":"WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter!72"
]
"BoundArguments":{
"rvtFile": {
"localName": "rac_basic_sample_project.rvt",
"url": "https://developer.api.autodesk.com/Masked:kRW0jj8ZUtU7QNO0DXCukH2NDJ4=",
"headers": {
"authorization": "Masked:IlrS8QJ3oW3Igi6Oe34QAwULA1Q="
}
},
"params": {
"localName": "params.json",
"url": "data:application/json,{'ViewName': {3D}}"
},
"result": {
"localName": "result.avr",
"url": "https://staging-appliedvrabs-pa.sandbox.googleapis.com/Masked:kQfE75mPkbGJwltY96k4UwHYNNY=",
"headers": {
"authorization": "Masked:GbZcVdSF7CkXGH0+4kYm/FaeCao="
},
"verb": "put"
},
"onProgress": {
"ondemand": true,
"url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Masked:UK/Z3b5X3xUWxXiH6C9r9i9UlRU=",
"headers": {
"Content-Type": "application/json",
"x-das-authorize": "awssigv4(us-east-1)",
"x-ads-token-data": "{\"access_token\":{\"client_id\":\"WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI\"},\"scope\":\"code:all data:write data:read bucket:create bucket:delete\",\"expires_in\":3599,\"client_id\":\"WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI\"}",
"x-ads-gateway-secret": "Masked:F6VCvje5cIP0zOGCxgARjmSopQI="
},
"verb": "put"
}
}
"Quotas":{
"limitProcessingTimeSec": 10800,
"limitTotalUncompressedAppsSizeInMB": 5000
}
[05/20/2022 20:39:13] Starting work item bc24e48e8f7548fe9262db12a7556055
[05/20/2022 20:39:13] Start download phase.
[05/20/2022 20:39:13] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/47f2a6e6-4349-4a9e-b066-14019b2d95ff.rvt'
[05/20/2022 20:39:13] Embedded resource [{'ViewName': {3D}}] is saved as file: T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\params.json.
[05/20/2022 20:39:14] End downloading file. Source=https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/47f2a6e6-4349-4a9e-b066-14019b2d95ff.rvt,LocalFile=T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\rac_basic_sample_project.rvt,BytesDownloaded=18739200,Duration=1107ms
[05/20/2022 20:39:14] End download phase successfully.
[05/20/2022 20:39:16] Start preparing script and command line parameters.
[05/20/2022 20:39:16] Command line: []
[05/20/2022 20:39:16] Identified standalone application at T:\Aces\AcesRoot\22.0\coreEngine\Exe/revitcoreconsole.exe /i T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\rac_basic_sample_project.rvt /al T:\Aces\Applications\53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package.
[05/20/2022 20:39:16] End preparing script and command line parameters.
[05/20/2022 20:39:16] Start script phase.
[05/20/2022 20:39:16] Start application 53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package standard output dump.
[05/20/2022 20:39:16] command line:'"T:\Aces\AcesRoot\22.0\coreEngine\Exe/revitcoreconsole.exe /i T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\rac_basic_sample_project.rvt /al T:\Aces\Applications\53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package" /isolate HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_bc24e48e8f7548fe9262db12a7556055 T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\userdata'
[05/20/2022 20:39:16] CreateProcess fails [ErrorCode:2]
[05/20/2022 20:39:16] Error details: The system cannot find the file specified.
[05/20/2022 20:39:17] End application 53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package standard output dump.
[05/20/2022 20:39:17] Error: Application 53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package exits with code 2 which indicates an error.
[05/20/2022 20:39:17] End script phase.
[05/20/2022 20:39:17] Error: An unexpected error happened during phase CoreEngineExecution of job.
[05/20/2022 20:39:17] Job finished with result FailedExecution
[05/20/2022 20:39:17] Job Status:
{
"status": "failedInstructions",
"reportUrl": "https://dasprod-store.s3.amazonaws.com/workItem/WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI/bc24e48e8f7548fe9262db12a7556055/report.txt?X-Amz-Expires=48600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEDUaCXVzLWVhc3QtMSJHMEUCIQD6%2F06ilWih8Y%2FlExEFSRdV29%2BkhzC9dnUiSRgrowI%2F3AIgWW0dFM7mesUZ9r%2Fay0jRdYM5WS5WLaKE70dUdIJ6pdIqmwIIHRADGgwyMjA0NzMxNTIzMTAiDBvJL%2Faj9DnxZRlQoir4AawLQ9ux77C8%2FCXfmKxVn52VplNguYCnlxSoCU6fZcEcXIJzLByNiYn%2Fh4cNZ7Pi%2B5yD%2FBQz9E%2FK7YxddYqRWn6%2FTJlT79dVYoCvigOP4sYClYT7Khqxpnlzdq%2FFKSPrhwVCeBJNBLLdgFXJywVasJqb95nXz%2FEb4zl1459EB7f1L%2BmMpiCi%2BpQgtXmybqC6YIoZAzRlQFGqOsdi%2FrpucSRTFz85uzXKe95ycI3u6AkjB9qIeFus%2FoGuSHCWmIYCLuFxv6N4paqXsf%2FGL4k0eaxlT8vvqc4BOfVSoKkSDP3asDWUTPBctRHllVn4JVYESTux805TB4i8MNDqn5QGOpoBFkJEETYYcw40DufOBaHwnASy1zn6lcSt3K3yDjzYZCJFrrO6sT0YT3Q0poH1W4Pn74YAHb0MFay8WspSghCNcUc5JrL1j1aqDchne8nCLu2tRJQXwIQD6ddJ7AXMnNVfrd12y%2FZlj1gjJxjKXsEK6syt2xg5LDmmMe%2F1iu40qxVq%2Bv3%2BjmsR05Fz52T3oIyuWYNjqojdudPwFA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIATGVJZKM3ITCDHE4L/20220520/us-east-1/s3/aws4_request&X-Amz-Date=20220520T203912Z&X-Amz-SignedHeaders=host&X-Amz-Signature=9b56fe0c0ac8fd968acdbb72ba073ab1041f3946e929d23d88ad885149bdbf66",
"stats": {
"timeQueued": "2022-05-20T20:39:12.695924Z",
"timeDownloadStarted": "2022-05-20T20:39:12.957438Z",
"timeInstructionsStarted": "2022-05-20T20:39:16.3503525Z",
"timeInstructionsEnded": "2022-05-20T20:39:17.5424815Z",
"bytesDownloaded": 18739218
},
"id": "bc24e48e8f7548fe9262db12a7556055"
}
Here is the activity definition:
url = '{0}/activities/{1}/versions'.format(self._das_api_root,
self.get_activity_name())
headers = self._get_request_headers()
data = {}
data['commandLine'] = [
'"$(engine.path)/revitcoreconsole.exe '
'/i $(args[rvtFile].path) '
'/al $(appbundles[' + self.get_app_bundle_name() + '].path)"'
]
data['parameters'] = {}
data['parameters']['rvtFile'] = {}
data['parameters']['rvtFile']['zip'] = False
data['parameters']['rvtFile']['ondemand'] = False
data['parameters']['rvtFile']['verb'] = 'get'
data['parameters']['rvtFile']['description'] = 'Input'
data['parameters']['rvtFile']['required'] = True
data['parameters']['params'] = {}
data['parameters']['params']['localName'] = 'params.json'
data['parameters']['params']['verb'] = 'get'
data['parameters']['params']['required'] = True
data['parameters']['result'] = {}
data['parameters']['result']['zip'] = False
data['parameters']['result']['ondemand'] = False
data['parameters']['result']['verb'] = 'put'
data['parameters']['result']['description'] = 'Result'
data['parameters']['result']['required'] = True
data['parameters']['result']['localName'] = 'result.avr'
data['engine'] = 'Autodesk.Revit+2022'
data['appbundles'] = [self.get_app_bundle()]
data['description'] = 'Export Geometry'
# Attempt to update the Activity.
response = requests.post(url, json=data, headers=headers)
And here is the workitem definition:
url = '{0}/workitems'.format(self._das_api_root)
headers = self._get_request_headers()
data = {}
data['activityId'] = self._activity_id
data['arguments'] = {}
data['arguments']['rvtFile'] = {}
data['arguments']['rvtFile']['url'] = download_url
data['arguments']['rvtFile']['localName'] = revit_file_name
data['arguments']['rvtFile']['headers'] = download_header
data['arguments']['params'] = {}
data['arguments']['params']['url'] = "data:application/json,{{'ViewName': {0}}}".format(view_name)
data['arguments']['result'] = {}
data['arguments']['result']['verb'] = 'put'
data['arguments']['result']['url'] = upload_url
data['arguments']['result']['headers'] = upload_header
response = self._http_client.request(url, 'POST', json.dumps(data), headers = headers)
By having a closer look at the report above, the problem is at the command line.
"T:\Aces\AcesRoot\22.0\coreEngine\Exe/revitcoreconsole.exe /i T:\Aces\Jobs\bc24e48e8f7548fe9262db12a7556055\rac_basic_sample_project.rvt /al T:\Aces\Applications\53f4ce6d27cb3f9b8d6727a1bc6e1b36.WDQIfAV8PqNa9XSKPmv6MDu3xAtLGfXI.Revit2ProtoExporter[72].package" cannot be identified as an executable, so it complained "Error details: The system cannot find the file specified."
The correct way to define command line, e.g.
"commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /al \"$(appbundles[RVTIOExportTestPackage2019].path)\"" ]
See the quotes around $(args[rvtFile].path)and $(appbundles[RVTIOExportTestPackage2019].path)
Related
I tried to make some http requests through GCP's Cloud Function with Python 3.10 runtime, some went well, and some went wrong.
To find out the reason, I ping the IP of each url, and the IP I need has no response:
ping ip(173.194.217.106) of url(https://www.google.com): True
ping ip(69.147.92.11) of url(https://www.yahoo.com): True
ping ip(13.107.42.14) of url(https://www.linkedin.com): True
ping ip(117.56.7.114) of url(https://data.moi.gov.tw): False
Is there any way to make a successful request to https://data.moi.gov.tw through Cloud Function?
Here are the materials to reproduce the results with Cloud Function (Gen1):
main.py:
import platform # For getting the operating system name
import subprocess # For executing a shell command
import requests
def ping(host):
"""
Returns True if host (str) responds to a ping request.
Remember that a host may not respond to a ping (ICMP) request even if the host name is valid.
"""
# Option for the number of packets as a function of
param = '-n' if platform.system().lower()=='windows' else '-c'
# Building the command. Ex: "ping -c 1 google.com"
command = ['ping', param, '1', host]
return subprocess.call(command) == 0
def main(event):
d_ip_url = {
'173.194.217.106' : 'https://www.google.com',
'69.147.92.11' : 'https://www.yahoo.com',
'13.107.42.14' : 'https://www.linkedin.com',
'117.56.7.114' : 'https://data.moi.gov.tw',
}
for ip, url in d_ip_url.items():
print(f'ping ip({ip}) of url({url}):', ping(ip))
requirements.txt:
# Function dependencies, for example:
# package>=version
requests
The cloud Function settings:
{
"name": "projects/corgis-361708/locations/asia-east1/functions/ping-test",
"httpsTrigger": {
"url": "https://asia-east1-corgis-361708.cloudfunctions.net/ping-test",
"securityLevel": "SECURE_ALWAYS"
},
"status": "ACTIVE",
"entryPoint": "main",
"timeout": "60s",
"availableMemoryMb": 256,
"serviceAccountEmail": "corgis-361708#appspot.gserviceaccount.com",
"updateTime": "2022-09-21T06:04:31.746Z",
"versionId": "2",
"labels": {
"deployment-tool": "console-cloud"
},
"sourceUploadUrl": "https://storage.googleapis.com/uploads-918581105162.asia-east1.cloudfunctions.appspot.com/78ad8f77-d16c-412c-843f-51238703fbbf.zip",
"runtime": "python310",
"maxInstances": 1,
"ingressSettings": "ALLOW_ALL",
"buildId": "0c8bf5d0-3467-4516-8fea-c39d0e093c2e",
"buildName": "projects/647355426154/locations/asia-east1/builds/0c8bf5d0-3467-4516-8fea-c39d0e093c2e",
"dockerRegistry": "CONTAINER_REGISTRY"
}
I am using VueJS3 cli. New in VueJS here :)
I have a csv file in my folder:
/src/db/example.csv
I would like to load it and use it as data structure, in the same way I do it with json files:
import jsonExample from "#/db/example.json";
If I try to do it with a csv file I get this:
import csvExample from "#/db/example.csv";
// You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
I tried to install the csv-loader
yarn add csv-loader
But I don't know where to add the configuration (https://www.npmjs.com/package/csv-loader#user-content-usage) I don't have any webpack configuration file :/, I have:
babel.config.js
jsconfig.json
package.json
vue.config.js
yarn.lock
I also tried to use papaparse directly:
this.$papa.parse("#/db/example.csv");
But I get this error:
{
"data": [
[
"#/db/exaple.csv"
]
],
"errors": [
{
"type": "Delimiter",
"code": "UndetectableDelimiter",
"message": "Unable to auto-detect delimiting character; defaulted to ','"
}
],
"meta": {
"delimiter": ",",
"linebreak": "\n",
"aborted": false,
"truncated": false,
"cursor": 19
}
}
Obviously it is interpreting the Path as a the Data.
Following instructions here: https://cli.vuejs.org/guide/webpack.html#working-with-webpack
I configured the loader like this:
// vue.config.js
const { defineConfig } = require('#vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
chainWebpack: config => {
// csv-loader
config.module
.rule('csv-loader')
.test(/\.csv$/)
.use('csv-loader')
.loader('csv-loader')
.end()
}
})
Now this is working:
import data from "#/db/example.csv";
PD: I had to restart yarn serve
I have an entity represented on the Context Broker with severall attributes (such as temperature, humidity etc...). I have a MySql database that persists the values from that entity by row. So in order to persist that info i have to make a subscription from cygnus. The problem here is that the information is being presisted but when i run the command (curl http://localhost:1026/v2/subscription) i get the output: [] as if any subscription was being made. If i do the command echo 'db.csubs.count()' | mongo orion --quiet it even shows the output 0.
Running OS: Centos 6
My Orion Context Broker Version: 0.26.0
Orion runs as a service:
/usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice
So from the first step. Let's assume i don't have any subscription made to the database. I run the command:
/usr/cygnus/bin/cygnus-flume-ng agent --conf /usr/cygnus/conf/ -f /usr/cygnus/conf/agent_a1.conf -n cygnusagent -Dflume.root.logger=INFO,console
to ensure that a flume agent is running.
python2.7 SetSubscription.py bus temperature http://188.???.??.???:5050/notify
The python script is the one provided in the fiware-figway folder provided in the github repository.
import requests, json, re
from collections import Counter
import ConfigParser
import io
import sys
CONFIG_FILE = "../config.ini"
NUM_ARG=len(sys.argv)
COMMAND=sys.argv[0]
if NUM_ARG==4:
ENTITY_ID=sys.argv[1]
ENTITY_ATTR=sys.argv[2]
SERVER_URL=sys.argv[3]
else:
print 'Usage: '+COMMAND+' [ENTITY ID] [ATTRIBUTE] [SERVER URL]'
print ' ENTITY ID = Entity you want to watch for changes/updates.'
print ' ATTRIBUTE = Attribute whose change will trigger notifications. In this example script only this attribute will be notified.'
print ' SERVER URL = (Local) Server listening for notifications.Example: http://myserver.domain.com:10000'
print ' It has to be a reachable address:port for the ContextBroker. If you are behind a NAT/Firewall contact your network admin.'
print
sys.exit(2)
# Load the configuration file
with open(CONFIG_FILE,'r+') as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(io.BytesIO(sample_config))
CB_HOST=config.get('contextbroker', 'host')
CB_PORT=config.get('contextbroker', 'port')
CB_FIWARE_SERVICE=config.get('contextbroker', 'fiware_service')
CB_AAA=config.get('contextbroker', 'OAuth')
if CB_AAA == "yes":
TOKEN=config.get('user', 'token')
TOKEN_SHOW=TOKEN[1:5]+"**********************************************************************"+TOKEN[-5:]
else:
TOKEN="NULL"
TOKEN_SHOW="NULL"
NODE_ID=config.get('local', 'host_id')
f.close()
CB_URL = "http://"+CB_HOST+":"+CB_PORT
MIN_INTERVAL = "PT5S"
DURATION = "P1M"
ENTITY_TYPE = ""
ENTITY_ATTR_WATCH = ENTITY_ATTR
ENTITY_ATTR_NOTIFY = ENTITY_ATTR
PAYLOAD = '{ \
"entities": [ \
{ \
"type": "'+ENTITY_TYPE+'", \
"isPattern": "false", \
"id": "'+ENTITY_ID+'" \
} \
], \
"attributes": [ \
"'+ENTITY_ATTR_NOTIFY+'" \
], \
"reference": "'+SERVER_URL+'", \
"duration": "'+DURATION+'", \
"notifyConditions": [ \
{ \
"type": "ONCHANGE", \
"condValues": [ \
"'+ENTITY_ATTR_WATCH+'" \
] \
} \
], \
"throttling": "'+MIN_INTERVAL+'" \
}'
HEADERS = {'content-type': 'application/json', 'accept': 'application/json' , 'Fiware-Service': CB_FIWARE_SERVICE ,'X-Auth-Token' : TOKEN}
#HEADERS = {'content-type': 'application/json', 'Fiware-Service': CB_FIWARE_SERVICE ,'X-Auth-Token' : TOKEN}
HEADERS_SHOW = {'content-type': 'application/json', 'accept': 'application/json' , 'Fiware-Service': CB_FIWARE_SERVICE , 'X-Auth-Token' : TOKEN_SHOW}
URL = CB_URL + '/v1/subscribeContext'
print "* Asking to "+URL
print "* Headers: "+str(HEADERS_SHOW)
print "* Sending PAYLOAD: "
print json.dumps(json.loads(PAYLOAD), indent=4)
print
print "..."
r = requests.post(URL, data=PAYLOAD, headers=HEADERS)
print
print "* Status Code: "+str(r.status_code)
print
print r.text
Now everytime that i make a change in the values, the value is changed and it is presisted in the database.
If you need any more information feel free to ask!
EDIT:
The payload "Asking to ", "Headers: " and "Sending payload":
* Asking to http://188.???.??.???:1026/v1/subscribeContext
* Headers: {'Fiware-Service': 'fiwarefinal', 'content-type': 'application/json', 'accept': 'application/json', 'X-Auth-Token': 'NULL'}
* Sending PAYLOAD:
{
"reference": "http://localhost:5050/notify",
"throttling": "PT5S",
"entities": [
{
"type": "",
"id": "bus1",
"isPattern": "false"
}
],
"attributes": [
"temperature"
],
"duration": "P1M",
"notifyConditions": [
{
"condValues": [
"temperature"
],
"type": "ONCHANGE"
}
]
}
...
* Status Code: 200
{
"subscribeResponse" : {
"subscriptionId" : "56781c2d071f621a6546e740",
"duration" : "P1M",
"throttling" : "PT5S"
}
}
Note that you are running Orion in multiservice mode. Thus, entities/attributes/subscriptions are separated by tentant/services completely isolated in different databases at MongoDB layer. In particular, note that the subscribe context request is using Fiware-Service: fiwarefinal so the subscription is created in the "fiwarefinal" service (associated to the orion-fiwarefinal DB).
Thus curl http://localhost:1026/v2/subscription will not show any subscription, as the subscrition query is resolved in the default tenant (associated to the orion database). The same for echo 'db.csubs.count()' | mongo orion --quiet. In order to get the subscription list (or count in DB) for the "fiwarefinal" service you should use:
curl --header 'Fiware-Service: fiwarefinal' http://localhost:1026/v2/subscription
echo 'db.csubs.count()' | mongo orion-fiwarefinal --quiet
Note that you also need to use Fiware-Service: fiwarefinal in the unsubscribe context operation if you want to remove subscription in the "fiwarefinal" tenant/service.
Please find, more information about multiservice mode and how it relates with DB level.
I tried drill JDBC driver to query programmatically.
Useful portion of code:
Connection conn = new Driver().connect("jdbc:drill:zk=local", getDefaultProperties());
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("show databases");
while (rs.next())
{
String SCHEMA_NAME = rs.getString("SCHEMA_NAME");
System.out.println(SCHEMA_NAME);
}
public static Properties getDefaultProperties()
{
final Properties properties = new Properties();
properties.setProperty(ExecConstants.HTTP_ENABLE, "false");
return properties;
}
Everything worked fine till I have cp & dfs storage plugin. Output of above query:
INFORMATION_SCHEMA
cp.default
dfs.default
dfs.root
dfs.tmp
sys
But when I added mongo as storage plugin with configuration:
{
"type": "mongo",
"connection": "mongodb://localhost:27017/",
"enabled": false
}
I got following exception:
java.sql.SQLException: Failure in starting embedded Drillbit: java.lang.RuntimeException: Unable to deserialize "/tmp/drill/sys.storage_plugins/mongo.sys.drill"
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:109)
at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:66)
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
at org.apache.drill.jdbc.Driver.connect(Driver.java:78)
at com.mkyong.App.main(App.java:37)
Caused by: java.lang.RuntimeException: Unable to deserialize "/tmp/drill/sys.storage_plugins/mongo.sys.drill"
at org.apache.drill.exec.store.sys.local.FilePStore.get(FilePStore.java:140)
at org.apache.drill.exec.store.sys.local.FilePStore$Iter$DeferredEntry.getValue(FilePStore.java:219)
at org.apache.drill.exec.store.StoragePluginRegistry.createPlugins(StoragePluginRegistry.java:168)
at org.apache.drill.exec.store.StoragePluginRegistry.init(StoragePluginRegistry.java:132)
at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:244)
at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:100)
... 5 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Could not resolve type id 'mongo' into a subtype of [simple type, class org.apache.drill.common.logical.StoragePluginConfig]
at [Source: [B#21318883; line: 2, column: 3]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
at com.fasterxml.jackson.databind.DeserializationContext.unknownTypeException(DeserializationContext.java:849)
at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:167)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:99)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:84)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:132)
at com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer.deserialize(TypeWrappedDeserializer.java:41)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1269)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:912)
at org.apache.drill.exec.store.sys.serialize.JacksonSerializer.deserialize(JacksonSerializer.java:44)
at org.apache.drill.exec.store.sys.local.FilePStore.get(FilePStore.java:138)
... 10 more
Also, how can I add plugin configuration programmatically?
Edit: Similar behaviour for hive.
Drill provides a REST API. I've used the curl command shown in the docs:
curl -X POST -/json" -d '{"name":"myplugin", "config": {"type": "file", "enabled": false, "connection": "file:///", "workspaces": { "root": { "location": "/", "writable": false, "defaultInputFormat": null}}, "formats": null}}' http://localhost:8047/storage/myplugin.json
I cloned the github project of figway in order to query the attributes of the entities to the orion but i'm getting an error in all python scripts:
File "GetEntity.py", line 37, in <module>
config = ConfigParser.RawConfigParser(allow_no_value=True)
TypeError: __init__() got an unexpected keyword argument 'allow_no_value'
I called it like -> python GetEntity.py Room
Some tips to investigate what is going on:
You should be using Python2.7 to run these scripts. Can you please let me know which version and OS are you using?
We have updated FIGWAY last week. Can you please clone it again if you did it before?
You should be using the new scripts at folder: /python-IDAS4/ContextBroker
With the previous assumptions you should get something like this (as long as that entity does not exist on that ContextBroker at the time being):
i6#raspberrypi ~/github/fiware-figway/python-IDAS4/ContextBroker $ python GetEntity.py Room
* Asking to http://130.206.80.40:1026/ngsi10/queryContext
* Headers: {'Fiware-Service': 'OpenIoT', 'content-type': 'application/json', 'accept': 'application/json', 'X-Auth-Token': 'NULL'}
* Sending PAYLOAD:
{
"entities": [
{
"type": "",
"id": "Room",
"isPattern": "false"
}
],
"attributes": []
}
...
* Status Code: 200
* Response:
{
"errorCode" : {
"code" : "404",
"reasonPhrase" : "No context element found"
}
}