ThingsBoard OPC-DA - thingsboard

Will thingsboard connect to a remote OPC-DA server? If so how do you configure the opc-config.json to connect to an IBA?
> { "servers": [
> {
> "applicationName": "",
> "applicationUri": "",
> "host": "10.x.x.x.",
> "port": 135,
> "scanPeriodInSeconds": 10,
> "timeoutInMillis": 5000,
> "security": "None",
> "identity": {
> "type": "username",
> "username": "me",
> "password": "me password"
> },
> "mapping": [
> {
> "deviceNodePattern": "Channel1\\.Device\\d+$",
> "deviceNamePattern": "Device ${_System._DeviceId}",
> "attributes": [
> {"key":"Tag1", "type": "string", "value": "${Tag1}"}
> ],
> "timeseries": [
> {"key":"Tag2", "type": "long", "value": "${Tag2}"}
> ]
> }
> ]
> } ] }
I've tried several different inputs in the config but the gateway is not sending back any values
This is the error i see in the log:
me#thingsboard:/etc/tb-gateway/conf$ cat
/var/log/tb-gateway/tb-gateway.log | grep ERROR 2017-10-25
13:42:00,900 [main] ERROR o.t.gateway.util.ConfigurationTools - Failed
to load class
org.thingsboard.gateway.extensions.opc.conf.OpcUaConfiguration
configuration from opc-config.json 2017-10-25 13:42:00,902 [main]
ERROR o.t.g.e.opc.DefaultOpcUaService - OPC-UA service configuration
failed! 2017-10-25 13:42:00,929 [main] ERROR
o.s.boot.SpringApplication - Application startup failed

The OPC-DA is not supported at the moment. ThingsBoard supports newer version of the protocol - OPC-UA. At the moment there is no plan to support the OPC-DA in our roadmap, but, since this is open-source project, feel free to contribute.

Related

"Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable."

I'm trying to build a container image that I will later use to update the code inside of a virtual machine. The docker image works fine as I can build and run it inside of my terminal. However, I keep getting an error when I try to deploy it to cloud run: "Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable." How can I fix this error?
The build log contains this:
Deploying container to Cloud Run service [SERVICE] in project [PROJECT_ID] region [REGION]
Deploying...
Creating Revision.......................................................................................................................................................................failed
Deployment failed
ERROR: (gcloud.run.deploy) Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.
The revision log contains this:
{
"protoPayload": {
"#type": "type.googleapis.com/google.cloud.audit.AuditLog",
"status": {
"code": 9,
"message": "Ready condition status changed to False for Revision {REVISION_NAME} with message: Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.\n\nLogs URL:{URL_LINK}"
},
"serviceName": "run.googleapis.com",
"resourceName": "{REVISION_NAME}",
"response": {
"metadata": {
"name": "{REVISION_NAME}",
"namespace": "{NAMESPACE}",
"selfLink": "{SELFLINK}",
"uid": "{UID}",
"resourceVersion": "{RESOURCEVER}",
"generation": 1,
"creationTimestamp": "{TIMESTAMP}",
"labels": {
"serving.knative.dev/route": "{SERVICE}",
"serving.knative.dev/configuration": "{SERVICE}",
"serving.knative.dev/configurationGeneration": "15",
"serving.knative.dev/service": "{SERVICE}",
"serving.knative.dev/serviceUid": "{SERVICE_UID}",
"cloud.googleapis.com/location": "{REGION}"
},
"annotations": {
"run.googleapis.com/client-name": "gcloud",
"serving.knative.dev/creator": "{NAMESPACE}#cloudbuild.gserviceaccount.com",
"client.knative.dev/user-image": "gcr.io/{PROJECT_ID}/{IMAGE}",
"run.googleapis.com/client-version": "357.0.0",
"autoscaling.knative.dev/maxScale": "100"
},
"ownerReferences": [
{
"kind": "Configuration",
"name": "{SERVICE}",
"uid": "{UID}",
"apiVersion": "serving.knative.dev/v1",
"controller": true,
"blockOwnerDeletion": true
}
]
},
"apiVersion": "serving.knative.dev/v1",
"kind": "Revision",
"spec": {
"containerConcurrency": 80,
"timeoutSeconds": 300,
"serviceAccountName": "{NAMESPACE}-compute#developer.gserviceaccount.com",
"containers": [
{
"image": "gcr.io/{PROJECT_ID}/{IMAGE}",
"ports": [
{
"name": "h2c",
"containerPort": 8080
}
],
"resources": {
"limits": {
"cpu": "1000m",
"memory": "512Mi"
}
}
}
]
},
"status": {
"observedGeneration": 1,
"conditions": [
{
"type": "Ready",
"status": "False",
"reason": "HealthCheckContainerError",
"message": "Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.\n\nLogs URL:{LOG_LINK}",
"lastTransitionTime": "{TIME}"
},
{
"type": "Active",
"status": "Unknown",
"reason": "Reserve",
"lastTransitionTime": "{TIME}",
"severity": "Info"
},
{
"type": "ContainerHealthy",
"status": "False",
"reason": "HealthCheckContainerError",
"message": "Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.\n\nLogs URL:{LOG_LINK}",
"lastTransitionTime": "{TIME}"
},
{
"type": "ResourcesAvailable",
"status": "True",
"lastTransitionTime": "{TIME}"
},
{
"type": "Retry",
"status": "True",
"reason": "ImmediateRetry",
"message": "System will retry after 0:00:00 from lastTransitionTime for attempt 0.",
"lastTransitionTime": "{TIME}",
"severity": "Info"
}
],
"logUrl": "{LOG_LINK}",
"imageDigest": "gcr.io/{PROJECT_ID}/{IMAGE_SHA}"
},
"#type": "type.googleapis.com/google.cloud.run.v1.Revision"
}
},
"insertId": "{ID}",
"resource": {
"type": "cloud_run_revision",
"labels": {
"location": "{REGION}",
"configuration_name": "{SERVICE}",
"service_name": "{SERVICE}",
"project_id": "{PROJECT_ID}",
"revision_name": "{REVISION_NAME}"
}
},
"timestamp": "{TIME}",
"severity": "ERROR",
"logName": "projects/{PROJECT_ID}/logs/cloudaudit.googleapis.com%2Fsystem_event",
"receiveTimestamp": "{TIME}"
}
This is my cloudbuild.yaml:
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/PROJECT_ID/IMAGE', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/PROJECT_ID/IMAGE']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: ['run', 'deploy', 'SERVICE-NAME', '--image', 'gcr.io/PROJECT_ID/IMAGE', '--region', 'REGION', '--port', '8080']
images:
- gcr.io/PROJECT_ID/IMAGE
This is my Dockerfile:
FROM python:3.9.7-slim-buster
WORKDIR /app
COPY . .
CMD [ "python3", "hello.py" ]
This is the code in hello.py:
print("Hello World")
When Cloud Run starts your container, a health check is sent to the container. Your container is not responding to the health check. Therefore, Cloud Run determines that your service is failing.
Cloud Run requires that a container provide service/process/program that listens for and responds to HTTP requests.
Your hello.py file only prints a message to stdout. Your program does not start a process to listen for requests.
A very simple example that converts your example into a working program:
import os
from flask import Flask
app = Flask(__name__)
#app.route('/')
def home():
return "Hello world"
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
Note: You will need to add a file requirements.txt to your build to include Flask. Create requirements.txt in the same location as Dockerfile.
requirements.txt:
Flask==2.0.1

Sonar webhook data 'stripped' in Jenkins

I'm using Jenkins DSL multibranch build paired with Sonarqube community + Community branch plugin.
So far, I was using waitForQualityGate to get Sonar's quality gate results back in Jenkins and it was working as expected. I was checking qg.status to display Sonar status but, now I tried to include more detailed info (list of failed checks) on my job page.
Problem is that, on Jenkins side, JSON printout of waitForQualityGate is just:
{"status":"ERROR"}
When I check on Sonar side, I see that hook is executed with expected payload:
{
"serverUrl": "http://localhost:9000",
"taskId": "AXGhfNdNVsTZztVdmx-_",
"status": "SUCCESS",
"analysedAt": "2020-04-22T10:43:26+0000",
"changedAt": "2020-04-22T10:43:26+0000",
"project": {
"key": "XXXXXX",
"name": "XXXXXX",
"url": "http://localhost:9000/dashboard?id=XXXXXX"
},
"branch": {
"name": "branch_name",
"type": "SHORT",
"isMain": false,
"url": "http://localhost:9000/project/issues?branch=branch_name&id=XXXXXX&resolved=false"
},
"qualityGate": {
"name": "MY_quality_gate",
"status": "ERROR",
"conditions": [
{
"metric": "new_reliability_rating",
"operator": "GREATER_THAN",
"value": "1",
"status": "OK",
"errorThreshold": "1"
},
{
"metric": "new_security_rating",
"operator": "GREATER_THAN",
"value": "1",
"status": "OK",
"errorThreshold": "1"
},
{
"metric": "new_maintainability_rating",
"operator": "GREATER_THAN",
"value": "3",
"status": "ERROR",
"errorThreshold": "1"
},
{
"metric": "new_coverage",
"operator": "LESS_THAN",
"value": "100.0",
"status": "OK",
"errorThreshold": "90"
}
]
},
"properties": {}
}
Please note that payload have status=SUCCESS and qualityGate.status=ERROR while, on Jenkins side, it defines status=ERROR and no qualityGate node at all?
Within job console log I can find:
[Pipeline] waitForQualityGate
Checking status of SonarQube task 'AXGh4vchVsTZztVdmx_J' on server 'SonarQube'
SonarQube task 'AXGh4vchVsTZztVdmx_J' status is 'SUCCESS'
SonarQube task 'AXGh4vchVsTZztVdmx_J' completed. Quality gate is 'ERROR'
I can not find any settings on Jenkins side that could be related to this issue (standard settings are set and normally working).
Version used:
Jenkins: 2.150.1
SonarQube Scanner plugin: 2.8.1
Sonarqube: 7.7.0.23042
Thx in advance for any tips or suggestions...

found ' Failed: Implicit Wait timed out after 30000ms' this error after play the testcase

My problem is that my code found a timed out error. This is my code:
{
"id": "7cff5f0f-49a0-4099-a4b4-6e50d5f38a1c",
"comment": "",
"command": "click",
"target": "name=OrderSearch[order_id]",
"targets": [
["name=OrderSearch[order_id]", "name"],
["css=input[name=\"OrderSearch[order_id]\"]", "css"],
["css=td:nth-child(1) > .form-control", "css:finder"],
["xpath=//input[#name='OrderSearch[order_id]']", "xpath:attributes"],
["xpath=//tr[#id='w0-filters']/td/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}

Mesos Marathon(ctl) Debugging - "Abnormal executor termination: unknown container"

I'm still new to Mesos, but am trying to figure out the best way to debug a Mesos application I'm attempting to develop. I'm getting the error message "Abnormal executor termination: unknown container" through the web application, and am unsure how to get more descriptive error messages to figure out what's going on. The error message would seem to indicate it can't find the Docker image, but I know for a fact it's referencing the correct image that is installed and running.
{
"id": "pgprimary",
"cmd": null,
"cpus": 1,
"mem": 128,
"disk": 0,
"instances": 1,
"container": {
"docker": {
"image": "example/postgres:centos7-10.0-1.6.0",
"network": "BRIDGE",
"parameters": [{
"key": "hostname",
"value": "pgprimary"
}],
"portMappings": [
]
},
"type": "DOCKER",
"volumes": [
{
"hostPath": "/mnt/nfsfileshare/pgdata",
"containerPath": "/pgdata",
"mode": "RW"
}
]
},
"env": {
"PG_MODE": "primary",
"PG_USER": "testuser",
"PG_PASSWORD": "testuser",
"PG_DATABASE": "userdb",
"PG_ROOT_PASSWORD": "password",
"PG_PRIMARY_USER": "primaryuser",
"PG_PRIMARY_PASSWORD": "password",
"PG_PRIMARY_PORT": "5432"
},
"labels": {},
"healthChecks": [
{
"protocol": "COMMAND",
"command": {
"value": "/usr/pgsql-10/bin/pg_isready --host=pgprimary.marathon.mesos"
},
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
]
}
The command I'm using to deploy the Marathon app:
marathonctl -h http://10.0.2.15:8080 app create postgres.json
Not image, but docker is what marathon cannot find.
Specify the use of the Docker containerizer:
echo 'docker,mesos' > /etc/mesos-slave/containerizers
Provisioning Containers with the Docker Containerizer
https://mesosphere.github.io/marathon/docs/native-docker.html

Atlassian Connect Express: Credentials rejected at connect-ace.atlassian.net

I'm evaluating atlassian-connect-express and just created an app
boilerplate with "atlassian-connect new", and then deployed it via ngrok
to my Jira dev account.
That works fine, but when I try to use the file "credentials.json" with
my account data, the plug starts with the error message:
Failed to register with host https‍://michael%40...:[My
password]#connect-ace.atlassian.net (401)
Add-on not registered; no compatible hosts detected
I get a similar message when I go to the url connect-ace.atlassian.net
Here my atlassian-connect.json
{
"key": "my-add-on",
"name": "Ping Pong",
"description": "My very first add-on",
"vendor": {
"name": "Angry Nerds",
"url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "https://xxxxxxx.ngrok.io",
"links": {
"self": "https://xxxxxxxx.ngrok.io/atlassian-connect.json",
"homepage": "https://xxxxxxx.ngrok.io/atlassian-connect.json"
},
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed"
},
"scopes": [
"READ"
],
"modules": {
"generalPages": [
{
"key": "hello-world-page-jira",
"location": "system.top.navigation.bar",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
},
{
"key": "hello-world-page-confluence",
"location": "system.header/left",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
}
]
}
}
and my credatials.json
{
"hosts": {
"connect-ace.atlassian.net": {
"product": "jira",
"username": "michael#---",
"password": "---password---"
}
}
}
How can I get my dev account working with connect-ace?
Two things to check:
1 - Check the if the credentials.json has correct values. host url should start with https://. Password is the api token generated from here.
{
"hosts": {
"https://<your atlassian site name>.atlassian.net": {
"product": "jira",
"username": "<jira user name>",
"password": "<Token created from https://id.atlassian.com/manage/api-tokens>"
}
}
}
2- Enable development mode at Settings -> Apps -> Manage Apps -> Settings. (This is required if the app is not published in marketplace)
This error is a default from atlas-connect
Print error image
In atlasssian-connect.json
replace this :
"lifecycle": {
"installed": "/installed"
},
for this:
"lifecycle": {
"installed": "installed"
},
Have you tried spawning your own cloud instance and testing it there? If not yet, try creating one here. Once successfully registered, in your credentials.json, change "connect-ace" with your baseUrl/sitename and with the right credentials, it should automatically install it for you.

Resources