Airflow Slack failed to send Message - airflow

I am trying to achieve Airflow integration with Slack,
have received the webhook URL, and created the connection as below. Why is it showing google.com ??
Why is it using the default http_conn_id and connecting to google ??
But got an error as below
ERROR - Error in sending a message to Slack channel #airflow-alerts
by Airflow: 404:Not Found
{base_hook.py:83} INFO - Using connection to: id: http_default. Host: https://www.google.com/, Port: None, Schema: None, Login: None, Password: None, extra: {}
{logging_mixin.py:95} INFO - [2020-05-29 12:43:21,374] {http_hook.py:128} INFO - Sending 'POST' to url: https://www.google.com//T00A6ASFHD8S/G1FDF4K/a3zfKsadfsrScxgadfsdafOIgIvgW
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://www.google.com//T00A6ASFHD8S/G1FDF4K/a3zfKsadfsrScxgadfsdafOIgIvgW
But I got the below error, unable to figure out

Your connection is not setup correctly, you need to select HTTP as the Conn Type, leave the Extra field blank and put the webhook token (format is /STRING/STRING/STRING) in the Password field. Then you can use the SlackWebhookOperator operator which allows you to set the channel and username.

I finally figured out after long struggle ...
There was a bug in SlackWebhookOperator in Airflow≤1.10.3 (Bug Jira Issue). This was fixed in 1.10.4 with this PR (fix commit).

Related

SSL error when creating vue.js app using api platform client generator

I tried to create client app of my API created using API Platform. I follow this guide https://api-platform.com/docs/client-generator/vuejs/.
I use Laravel Homestead for the VM when developing it.
I've added myapp .crt file to Keychan Access.
Problem was, when I try to execute
generate-api-platform-client --generator vue https://myapp-api.local/api src/
It return error message like this:
{
api: Api { entrypoint: 'https://myapp-api.local/api', resources: [] },
error: FetchError: request to https://myapp-api.local/api failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/Users/permana.jayanta/.config/yarn/global/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (events.js:209:13)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:209:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
name: 'FetchError',
message: 'request to https://myapp-api.local/api failed, reason: unable to verify the first certificate',
type: 'system',
errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
},
response: undefined,
status: undefined
}
I'm thinking this is related with SSL certificate. That node doesn't recognise the certificate. How to make node.js recognise the custom SSL certificate generated by Homestead?
it failed to verify https signature.
To disable it, type in shell
export NODE_TLS_REJECT_UNAUTHORIZED=0

Session not created error with physical device

I've been trying to run automated tests with Appium, they are already running in physical devices, but I get the error: [WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session"}
I've gone through the configuration guide and the webDriverAgent seems to be running correctly in the device, when I make a request to the webdriveragent running on the device I get the response:
[WD Proxy] Determined that the downstream protocol for proxy is W3C
[XCUITest] WebDriverAgent information:
[XCUITest] {
[XCUITest] "message": "WebDriverAgent is ready to accept commands",
[XCUITest] "state": "success",
However, when Appium makes the request to create a new WDA session, receives the following response:
[WD Proxy] Got an unexpected response: {"value":{"error":"session not created","message":"'capabilities' is mandatory to create a new session"},"sessionId":"595F87C8-0564-4B75-94B4-7D67BA0AF382"}
Using these capabilities
'app': app,
'bundleId' : bundle_id,
'platformName': platform_name,
'automationName': automation_name,
'platformVersion': platform_version,
'deviceName': device_name,
'udid': udid,
'xcodeOrgId': xcode_org_id,
'xcodeSigningId': xcode_signing_id,
'newCommandTimeout': new_command_timeout,
'updatedWDABundleId': updated_WDA_Bundle_Id,
'agentPath': "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj",
'bootstrapPath': "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent"
Is there anything else I might be missing?
Not sure if these capabilities are actually required:
'updatedWDABundleId': updated_WDA_Bundle_Id,
'agentPath': "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj",
'bootstrapPath': "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent"
try removing them, also in my tests i have noticed that it is necessary to restart the appium server everytime you switch from real device to simulator.
Hope it helps

How to handle expected prompt in ansible ios_config module

I am trying to implement couple simple commands on cisco ios devices using Ansible (ios_config module).
Especially, I want to remove user profile, but it requires to answer on a prompt and I am getting timeout error...
I have noticed that there are prompt/answer parameters in ios_command module, but it seems that it is not supported in ios_config module.
Has anyone run into the similar problem?
Ansible Task:
- name: remove user on remote devices
ios_config:
lines:
- no username testuser
provider: "{{ provider }}"
Output from Cisco device:
Cisco_Router(config)#no username testuser
This operation will remove all username related configurations with same name.Do you want to continue? [confirm]
Playbook output:
TASK [remove user on remote devices] *************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: timeout trying to send command: end
fatal: [Cisco_Router]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_3_OlXK/ansible_module_ios_config.py\", line 583, in <module>\n main()\n File \"/tmp/ansible_3_OlXK/ansible_module_ios_config.py\", line 512, in main\n load_config(module, commands)\n File \"/tmp/ansible_3_OlXK/ansible_modlib.zip/ansible/module_utils/network/ios/ios.py\", line 168, in load_config\n File \"/tmp/ansible_3_OlXK/ansible_modlib.zip/ansible/module_utils/connection.py\", line 149, in __rpc__\nansible.module_utils.connection.ConnectionError: timeout trying to send command: end\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
Starting with Ansible 2.4 there is an ios_user module that can be used to create, edit and remove users.
Removing a specific user with state: absent
- name: set user view/role
ios_user:
name: testuser
state: absent
provider: "{{ provider }}"
The full documentation and further examples can be found at: https://docs.ansible.com/ansible/latest/modules/ios_user_module.html
_command modules and prompts
The various _command modules, including ios_command support passing prompts.
For example:
- name: run commands that require answering a prompt
ios_command:
commands:
- command: 'clear counters GigabitEthernet0/1'
prompt: 'Clear "show interface" counters on this interface \[confirm\]'
answer: 'y'
- command: 'clear counters GigabitEthernet0/2'
prompt: '[confirm]'
answer: "\r"
See https://docs.ansible.com/ansible/latest/modules/ios_command_module.html for further info.
the prompt waits for a confirmation it seems so you need to confirm the command with a second line, so you likely have to do that.
- name: remove user on remote devices
ios_config:
lines:
- no username testuser
- yes
provider: "{{ provider }}"
I have tried this as well.
It seems that ios_config module is looking for a hostname(config)# prefix after executing each line. Thats why second line is not processing at all and I got the same notification - timeout.

Unable to access `Google Endpoints API` with firebase auth

Sorry I don't know If I should ask the question here. I used the echo sample project and
deploy it to google cloud endpoints, and I want to configure it with firebase auth instead of api key. the following is the openapi.yaml
paths:
"/echo":
post:
description: "Echo back a given message."
operationId: "echo"
produces:
- "application/json"
responses:
200:
description: "Echo"
schema:
$ref: "#/definitions/echoMessage"
parameters:
- description: "Message to echo"
in: body
name: message
required: true
schema:
$ref: "#/definitions/echoMessage"
security:
- firebase: []
And when I deploy it and access with
curl -d '{"message":"hello world"}' -H "content-
type:application/json""http://[IPADDRESS]:80/echo"
I get the error message.
"message": "Method doesn't allow unregistered callers (callers without
established identity). Please use API Key or other form of API consumer
identity to call this API.",
And if I add the api key.
curl -d '{"message":"hello world"}' -H "content-type:application/json""http://35.194.225.89:80/echo?api_key=[API_KEY]"
I can get the correct result.
I am not sure how to configure the openapi.yaml, please help. thank you very much.

How to configure Airflow URL in email alert

Does anyone know how to configure airflow such that link in the email alert is not pointing to localhost:
Try 1 out of 2
Exception:
Bash command failed
Log: Link
Host: vm232
Log file: /home/dev/airflow/logs/test_email_alert/email_alert/2017-03-15T20:00:00.log
Mark success: Link
Link i got is "localhost"
Thanks
In airflow.cfg, there's a section called webserver. Under that you will find a parameter called base_url. Configure that for the e-mail.

Resources