Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TwilioExecution task throwing Authentication Error - No credentials provided #167

Open
shrutimantri opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working

Comments

@shrutimantri
Copy link
Contributor

Expected Behavior

The TwilioExecution task should execute successfully.

I tried it programmatically using the appropriate values with the following python code:

import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = "AC....."
auth_token = "70........"
client = Client(account_sid, auth_token)

service = client.notify.v1.services.create()

print(service)

notification = client.notify.v1.services(service.sid) \
    .notifications.create(identity="00000001", body="Hello Bob")

print(notification)

And the above code runs successfully. Same values were used in the Kestra task.

Reference: https://www.twilio.com/docs/notify/api/service-resource

Actual Behaviour

The TwilioExecution task throws error:

2024-10-11 11:18:33,375 ERROR WorkerThread f.n.7.5QalM1dz4OHviV566WsFhs Authentication Error - No credentials provided
io.micronaut.http.client.exceptions.HttpClientResponseException: Authentication Error - No credentials provided
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.makeErrorFromRequestBody(DefaultHttpClient.java:2257)
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.forwardResponseToPromise(DefaultHttpClient.java:2211)
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.channelReadInstrumented(DefaultHttpClient.java:2181)
	at io.micronaut.http.client.netty.DefaultHttpClient$FullHttpResponseHandler.channelReadInstrumented(DefaultHttpClient.java:2149)
	at io.micronaut.http.client.netty.SimpleChannelInboundHandlerInstrumented.channelRead0(SimpleChannelInboundHandlerInstrumented.java:46)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)

Steps To Reproduce

  1. Ran the example flow with appropriate values

Environment Information

  • Kestra Version: 0.19.1
  • Plugin version: 0.19.1
  • Operating System (OS / Docker / Kubernetes): Docker
  • Java Version (If not docker):

Example flow

id: notify_on_failure
namespace: company.team

tasks:
  - id: send_twilio_notification
    type: io.kestra.plugin.notifications.twilio.TwilioExecution
    url: "{{ secret('TWILIO_ALERT_URL') }}" # format: https://notify.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications
    identity: "0000001"
    executionId: "{{ trigger.executionId }}"
    accountSID: "{{ secret('TWILIO_ACCOUNT_SID') }}"
    authToken: "{{ secret('TWILIO_AUTH_TOKEN') }}"
    body: "Kestra Workflow Failure: {{ execution.id }} has failed on {{ taskrun.startDate }}"

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatusCondition
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
        namespace: company
        comparison: PREFIX
@shrutimantri shrutimantri added the bug Something isn't working label Oct 11, 2024
@kestrabot kestrabot bot added this to Issues Oct 11, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Oct 11, 2024
@anna-geller anna-geller added the area/plugin Plugin-related issue or feature request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugin Plugin-related issue or feature request bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants