You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/18 13:26:52 UTC

[GitHub] [airflow] seybi87 commented on issue #13739: Trigger a DAG Run via the Stable REST API fails with FORBIDDEN

seybi87 commented on issue #13739:
URL: https://github.com/apache/airflow/issues/13739#issuecomment-762249940


   @mik-laj thanks a lot for pointing that out, I overlook this in the docs.
   
   I changed the auth backend to 
   `auth_backend = airflow.api.auth.backend.basic_auth`
   
   and added the following code snippet to the java code 
   
   ```
   defaultClient.setUsername("admin");
   defaultClient.setPassword("secret");
   ```
   This user has admin rights and is also used to log into the web interface.
   
   But when executing the java code, I receive  a `UNAUTHORIZED` exception: 
   
   ``` 
   org.openapitools.client.ApiException: UNAUTHORIZED
   	at org.openapitools.client.ApiClient.handleResponse(ApiClient.java:1012)
   	at org.openapitools.client.ApiClient.execute(ApiClient.java:925)
   	at org.openapitools.client.api.DagRunApi.postDagRunWithHttpInfo(DagRunApi.java:740)
   	at org.openapitools.client.api.DagRunApi.postDagRun(DagRunApi.java:715)
   	at de.baas.evaluation.scheduler.airflow.ExternalTrigger.triggerDAGRun(ExternalTrigger.java:46)
   	at de.baas.evaluation.scheduler.service.BaaSScheduler$1.message(BaaSScheduler.java:60)
   	at de.baas.evaluation.scheduler.service.BaaSScheduler$1.message(BaaSScheduler.java:53)
   	at io.lettuce.core.pubsub.PubSubEndpoint.notifyListeners(PubSubEndpoint.java:217)
   	at io.lettuce.core.pubsub.PubSubEndpoint.notifyMessage(PubSubEndpoint.java:206)
   	at io.lettuce.core.pubsub.PubSubCommandHandler.doNotifyMessage(PubSubCommandHandler.java:292)
   	at io.lettuce.core.pubsub.PubSubCommandHandler.notifyPushListeners(PubSubCommandHandler.java:223)
   	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:606)
   	at io.lettuce.core.pubsub.PubSubCommandHandler.decode(PubSubCommandHandler.java:112)
   	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:560)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
   	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
   	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   Do I need to set the credentials in a differnt way for basic auth?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org