Unable to read from Jfrog Artifactory - artifactory

I am attempting to connect to Artifactory to read a Java zip file with the admin user. The call is made through Talend Restful API interface (described below).
Expected result:
To read the file stored in Artifact repository and copy it to a server
To see a record of the access in the access.log file
Actual:
There is a line in the request.log with the HTTP code 200 , but there is nothing recorded in the access.log. How do I find out what the issue is?
About Talend Restful API:
Talend has a way to call its Java based jobs through its Talend Administrator Console (TAC), a web based interface by creating an object called a task. The task refers to a Java zipped file stored in Artifactory, connects to Artifactory and copies it to the machine where TAC runs and executes it. When this action is done through TAC itself, it works. But when it is called through Talend Restful API, we get the error "{"error":"nexus.error.wrongstatus","returnCode":181}"
The Restful call (calling from TAC server):
./MetaServletCaller.sh --tac-url http://... -json '{"actionName": "associatePreGeneratedJob", "active": true, "artifactoryArtifactId": "job_showMsg2", "artifactoryGroupId": "test.job", "artifactoryRepository": "snapshot", "artifactoryVersion": "0.1.0", "authPass": "xxx", "authUser": "xxx", "contextName": "Default", "description": "test_jb1 description", "executionServerName": "jbsrv", "importType": "Artifactory", "logLevel": "Info", "onUnknownStateJob": "WAIT", "pauseOnError": false, "taskName": "job_test", "taskType": "Artifact","targetConductor":"JOBCONDUCTOR", "timeout": 3600}'

Related

Apify with Python : Account authorization key not found in the system

I was trying the free trial version of recaptcha solver by apify for the following page https://www.google.com/recaptcha/api2/demo
Input :
{
"key": "apify_api_KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK",
"webUrl": "https://www.google.com/recaptcha/api2/demo",
"siteKey": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}
I tried running the same with the above inputs, but I get the error
2022-08-14T10:13:34.970Z ACTOR: Pulling Docker image from repository.
2022-08-14T10:13:35.109Z ACTOR: Creating Docker container.
2022-08-14T10:13:35.168Z ACTOR: Starting Docker container.
2022-08-14T10:13:36.323Z
2022-08-14T10:13:36.327Z WARNING: The npm start script not found in package.json. Using "node main.js" instead. Please update your package.json file. For more information see https://github.com/apifytech/apify-cli/blob/master/MIGRATIONS.md
2022-08-14T10:13:36.330Z
2022-08-14T10:13:38.579Z Solving re-captcha with Anticaptcha: https://www.google.com/recaptcha/api2/demo
2022-08-14T10:13:38.780Z User function threw an exception:
2022-08-14T10:13:38.782Z Account authorization key not found in the system
You need to have an anti-captcha subscription to be able to use it. https://apify.com/petr_cermak/anti-captcha-recaptcha
"key": ANTI_CAPTCHA_KEY
You trying to use Apify API key to authorize access to anti-captcha.com service, it fails with error Account authorization key not found in the system

Cloud Build Trigger - Not in Firebase app directory error

I have problem with deploying node.js (Angular) application from Bitbucket repository to Firebase using Cloud Build Trigger.
I performed steps from this article - https://cloud.google.com/build/docs/deploying-builds/deploy-firebase
Necessary APIs are turned on,
Service account has all required permissions,
Firebase community builder is deployed and visible in Container Registry,
Cloudbuild.json file is added to repository,
Cloud Build Trigger is created and it points to one specific branch of my repository.
Problem is that after running Cloud Build Trigger I receive following error: "Error: Not in Firebase app directory (could not locate firebase.json)"
What could be reason of such error? Is it possible to point to the trigger where in repository is firebase application and firebase.json file?
EDIT:
My cloudbuild.json file is quite simple:
{
"steps": [
{
"name": "gcr.io/PROJECT_NAME/firebase",
"args": [
"deploy",
"--project",
"PROJECT_NAME",
"--only",
"functions"
]
}
]
}
Logs in Cloud Build Trigger history:
starting build "build_id"
FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/link
* branch branch_id -> FETCH_HEAD
HEAD is now at d8bc2f1 Add cloudbuild.json file
BUILD
Pulling image: gcr.io/PROJECT/firebase
Using default tag: latest
latest: Pulling PROJECT/firebase
1e987daa2432: Already exists
a0edb687a3da: Already exists
6891892cc2ec: Already exists
684eb726ddc5: Already exists
b0af097f0da6: Already exists
154aee36a7da: Already exists
37e5835696f7: Pulling fs layer
62eb6e670f1d: Pulling fs layer
47e62615d9f9: Pulling fs layer
428cea824ccd: Pulling fs layer
765a2c722bf9: Pulling fs layer
b3f5d0a285e3: Pulling fs layer
428cea824ccd: Waiting
765a2c722bf9: Waiting
b3f5d0a285e3: Waiting
47e62615d9f9: Verifying Checksum
47e62615d9f9: Download complete
62eb6e670f1d: Verifying Checksum
62eb6e670f1d: Download complete
765a2c722bf9: Verifying Checksum
765a2c722bf9: Download complete
b3f5d0a285e3: Verifying Checksum
b3f5d0a285e3: Download complete
37e5835696f7: Verifying Checksum
37e5835696f7: Download complete
428cea824ccd: Verifying Checksum
428cea824ccd: Download complete
37e5835696f7: Pull complete
62eb6e670f1d: Pull complete
47e62615d9f9: Pull complete
428cea824ccd: Pull complete
765a2c722bf9: Pull complete
b3f5d0a285e3: Pull complete
Digest: sha256:4b6b7214d6344c8247130bf3f5443a2851e39aed3ececb32dfb2cc25a5c07e44
Status: Downloaded newer image for gcr.io/PROJECT/firebase:latest
gcr.io/PROJECT/firebase:latest
Error: Not in a Firebase app directory (could not locate firebase.json)
ERROR
ERROR: build step 0 "gcr.io/PROJECT/firebase" failed: step exited with non-zero status: 1
Firebase.json file is placed in repository in following path: /apps/firebase/firebase.json
I can't see any possibility to point that path in Cloud Build Trigger config.
I'm pretty sure that you aren't in the correct directory when you run the command. To check this, you can add this step
{
"steps": [
{
"name": "gcr.io/cloud-builders/gcloud",
"entrypoint":"ls"
"args": ["-la"]
}
]
}
If you aren't in the correct directory, and you need to be in the ./app/firebase to run your deploy, you can add this parameter in your step
{
"steps": [
{
"name": "gcr.io/PROJECT_NAME/firebase",
"dir": "app/firebase",
"args": [
"deploy",
"--project",
"PROJECT_NAME",
"--only",
"functions"
]
}
]
}
Let me know if it's better

Errors when Deploying ARM Template

I am attempting to deploy new resources and update to existing using my original ARM Templates that I deployed with a few months ago. Unfortunately, the deployment does not get to Azure, as I do not see a deployment entry in my resource group. The error that is presented is local before things start calling into Azure.
I am deploying using the Visual Studio 2017 Arm Template Deployment Context menu.
Here is the error that is output. I get this and a nearly identical one when running the validation command as well.
08:58:22 - VERBOSE: Performing the operation "Creating Deployment" on target "MigrationPlaybook_Prod".
08:58:23 - New-AzureRmResourceGroupDeployment : Multiple error occurred: Forbidden,Forbidden. Please see details.
08:58:23 - At C:\workspaces\Migration Playbook\MigrationPlaybookRegion\ProductionResourceGroup\bin\Debug\staging\ProductionResourc
08:58:23 - eGroup\Deploy-AzureResourceGroup.ps1:108 char:5
08:58:23 - + New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $Templat ...
08:58:23 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
08:58:23 - + CategoryInfo : CloseError: (:) [New-AzureRmResourceGroupDeployment], CloudException
08:58:23 - + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDep
08:58:23 - loymentCmdlet
08:58:23 -
08:58:24 -
08:58:24 - Template deployment returned the following errors:
08:58:24 - Multiple error occurred: Forbidden,Forbidden. Please see details.
Mitigations:
The template involves a KeyVault - I made sure that the ARM Template permission was Enabled
The project is several months old - I generated a new project to make sure that the PowerShell script, that is generated into the project at creation time, did not have any significant change
Account permissions - I have verified that my account permissions on the subscription has not changed in a way to prevent me from adding/modifying resources
While the mitigations address issues that arise when the ARM Template is being deployed the error, and its resulting records, suggest that there is an issue before it gets to Azure.
What could be the issue here and what can I do to remedy this?
I have seen the same error message when using a Key Vault to store username and password secrets but forgot to 'Enable for template deployment' on the Key Vault resource, and then referencing those secrets to pass credentials in the deployment of SQL server. Have you ensured that the Key Vault section in the ARM template has the option enabled where "enabledForTemplateDeployment": true?
Mine looks something like:
{
"type": "Microsoft.KeyVault/vaults",
"apiVersion": "2016-10-01",
"name": "[variables('keyVaultName')]",
"location": "[resourceGroup().location]",
"tags": "[parameters('baseParameters').tagValues]",
"scale": null,
"dependsOn": [],
"properties": {
"sku": {
"family": "A",
"name": "standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [],
"enabledForDeployment": true,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": true
}
},
When enabled, it will look like the following in the portal:
Just to check, I intentionally removed (disabled) the setting and the result looks similar to your error. Using the arguments -Verbose -Debug helped me to see the details.
I know that this isn't a real answer, but I don't have enough reputation yet to just comment. I've seen similar error messages in a subscription that had a limited number of cores and when I was trying to deploy more VMs. However I also am not convinced that this is your problem ...
what I wanted to ask was what happens when you try and deploy the ARM template from the Azure portal using the "Deploy a Custom Template"? This might give you some better hints as to what exactly is going wrong.

Adding a connector to Kafka Connect

I am using Confluent Kafka Docker image, specifically using this: https://github.com/confluentinc/cp-docker-images/tree/4.0.x/examples/cp-all-in-one
I want to add the MySQL connector, by:
downloading the version 1.5.46 of the connector (https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.46.tar.gz)
mounting a volume with a jar that comes out of the downloaded connector (mysql-connector-java-5.1.46-bin.jar)
adding the CONNECT_PLUGIN_PATH to the docker compose file
Basically, extrapolating the part of interest form the compose file, this is the important snippet:
environment:
<cut>
CONNECT_PLUGIN_PATH: '/etc/kafka-connect/jars/'
volumes:
- "./mysql_connector:/etc/kafka-connect/jars/"
The JAR is correctly present in the Docker container.
But, of course, if I try to use the connector, I can't find in the list of the enabled connectors. If I go to control center, I see:
[{
"class": "org.apache.kafka.connect.file.FileStreamSinkConnector",
"type": "sink",
"version": "1.0.0-cp1"
}, {
"class": "org.apache.kafka.connect.file.FileStreamSourceConnector",
"type": "source",
"version": "1.0.0-cp1"
}]
Your plugin path needs to contain the path to the actual JDBC Connect JAR files as well as the MySQL JAR
If you mount the MySQL JAR under this path
/usr/share/java/kafka-connect-jdbc
Then set the CONNECT_PLUGIN_PATH=/usr/share/java, then you have access to all bundled connectors. And the JDBC Connector will be able to read/write MySQL data.

How to use complex-number of kairosdb from REST

I am checking if I can use kairosdb for my project. I was checking out the REST api's and I have a use case where I need to save both my device state and status (state tells if device is on or off and status tells if my device is occupied or empty)
kairosdb version: 1.1.1
I came across this link https://kairosdb.github.io/docs/build/html/restapi/AddDataPoints.html
but when I try to post data from REST client I am getting the error 400 BAD Request error. The error is
{"errors":["Unregistered data point type 'complex-number'"]}
My request I am posting is ,
{
"name": "device_data",
"type": "complex-number",
"datapoints": [
[
1470897496,
{
"state": 0,
"status": "empty"
}
]
],
"tags": {
"device_id": "abc123"
}
}
In tried doing the same in Java as specified in https://kairosdb.github.io/docs/build/html/kairosdevelopment/CustomData.html
I get the same error i
Please let me know how to use complex-numbers or custom data types from REST
Recently, I figured out how to use this.
Using the example from the official document of KairosDB.
create 2 files called ComplexDataPoint.java and ComplexDataPointFactory.java and then paste the code provided by the tutorial on the doc: https://kairosdb.github.io/docs/build/html/kairosdevelopment/CustomData.html#example-for-creating-custom-types
download the KairosDB source, then extract the .zip file.
paste the 2 files in /KAIROSDB_DOWNLOADED_SOURCE/src/main/java/org/kairosdb/core/datapoints/
configure the CoreModule.java at /KAIROSDB_DOWNLOADED_SOURCE/src/main/java/org/kairosdb/core/, add the following line in the function protected void configure():
bind(ComplexDataPointFactory.class).in(Singleton.class);
open terminal, cd to KAIROSDB_DOWNLOADED_SOURCE/, then follow the instruction in the file how_to_build.txt
when complete, it will create a folder called build, the compiled kairosdb jar file is located in KAIROSDB_DOWNLOADED_SOURCE/build/jar
in your kairosdb installation folder, backup the kairosdb-X.X.X.jar file in YOUR_KAIROSDB_INSTALLATION/lib
mv kairosdb-X.X.X.jar kairosdb-X.X.X.jar.backup
mv the newly compiled jar file to YOUR_KAIROSDB_INSTALLATION/lib
modify the configuration file by adding the following line:
kairosdb.datapoints.factory.complex=org.kairosdb.core.datapoints.ComplexDataPointFactory
restart your kairosdb
For your query, since the registered name is kairosdb.datapoints.factory.complex, replace complex-number with complex in your query string.
Hope this will help you! I am now having a problem to plot the complex data. I am still figuring out...

Resources