11 Replies Latest reply: Apr 17, 2018 3:23 AM by Ruan Haese RSS

    QlikBotNet- "LogOnError"

    Akshay Anandbabu

      I get this error when I try to run the bot.exe

       


      018-01-31 09:19:56: Starting Log...

      2018-01-31 09:19:56: logInfo ID:522917336 First:XXXX Last: UserName:XXXXX <Timer for alerts started with 60 seconds>

      2018-01-31 09:19:56: Starting Log...

      2018-01-31 09:19:56: Started and Callback set for Bot

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:57: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:58: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:58: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:58: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

      2018-01-31 09:19:58: logError ID:522917336 First:XXXXX Last: UserName:XXXXX <Error opening the Qlik Sense app : Qlik.Sense.JsonRpc.CommunicationErrorException: Connection failed after 4 attempts. Error message:

        Correct authentication information wasn't sent from Proxy: Qlik.Sense.Communication.Communication.Proxy.ClientAuthenticationInformation ---> System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonException: Correct authentication information wasn't sent from Proxy: Qlik.Sense.Communication.Communication.Proxy.ClientAuthenticationInformation

         --- End of inner exception stack trace ---

         at Qlik.Sense.JsonRpc.RpcConnection.<OpenAsync>d__43.MoveNext()

      --- End of stack trace from previous location where exception was thrown ---

         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

         at Qlik.Sense.JsonRpc.RpcConnection.<EnsureConnectionIsOpen>d__54.MoveNext()

      --- End of stack trace from previous location where exception was thrown ---

         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

         at Qlik.Sense.JsonRpc.RpcConnection.<SendAsync>d__52.MoveNext()

         --- End of inner exception stack trace ---

         at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)

         at Qlik.Engine.Communication.QlikConnection.Ping(Nullable`1 noVersionCheck)

         at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session, Nullable`1 noVersionCheck)

         at Qlik.Engine.LocationExtensions.GetAppIdentifiers(ILocation location, Nullable`1 noVersionCheck)

         at Qlik.Engine.LocationExtensions.AppWithIdOrDefault(ILocation location, String appId, Nullable`1 noVersionCheck)

         at QlikSenseEasy.QSApp.QSOpenApp() in C:\Users\baz\Documents\GitHub\QlikBotNet\Bot Development\QlikSenseEasy\QSEasy.cs:line 357

         at QlikTelegram.Bot..ctor() in C:\Users\baz\Documents\GitHub\QlikBotNet\Bot Development\QlikTelegram\Bot.cs:line 163>

        • Re: QlikBotNet- "LogOnError"
          Akshay Anandbabu

          Sorry I am fairly new to this, so kindly bear

          • Re: QlikBotNet- "LogOnError"
            Carlos Alonso

            I am in the same situation. I don't know if I need to put SSL or not in DemoqsServerSSL property.

            I think I must have an error in the proxy definition.

            • Re: QlikBotNet- "LogOnError"
              Jeroen Beunckens

              I have exactly the same issue. Have you found a solution already?

                • Re: QlikBotNet- "LogOnError"
                  Devanathan Thirugnanam

                  Hi,

                   

                  I am also running into this error

                   

                  I am getting the below error every 5 seconds

                  logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

                   

                  and error

                  System.AggregateException: One or more errors occurred. ---> Telegram.Bot.Exceptions.ApiRequestException: Forbidden: bot can't send messages to bots

                     at Telegram.Bot.TelegramBotClient.<MakeRequestAsync>d__51`1.MoveNext()

                     --- End of inner exception stack trace ---

                     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

                     at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

                     at System.Threading.Tasks.Task.Wait()

                     at QlikTelegram.Bot..ctor()

                   

                  at the code (Bot.cs, line: 206)

                  botClient.SendTextMessageAsync(cntTelegramAdministratorID, "The bot " + me.Username + " is now running.", replyMarkup: new ReplyKeyboardRemove()).Wait();

                    • Re: QlikBotNet- "LogOnError"
                      Ruan Haese

                      "Telegram.Bot.Exceptions.ApiRequestException: Forbidden: bot can't send messages to bots"


                      Are you sure the channel ID you are sending to is correct?

                      If you enter the bots ID then its sending a message to itself / a bot which is not allowed by Telegram.

                      Try opening a new channel, getting that ID and make sure the messages go there instead.

                      • Re: QlikBotNet- "LogOnError"
                        Akshay Anandbabu

                        check

                        <add key="cntBotLocalAdministrator" value="XXXX" />

                            <add key="cntTelegramAdministratorID" value="XXXX" />

                        try adding your telegram id in both "XXXX".

                         

                        Also check,

                          <add key="cntAlternativeStreams" value="Everyone;Bots" />

                        You should be having the Bots stream in here like i have added above

                         

                        All these changes are made in the config file. Hope this helps

                          • Re: QlikBotNet- "LogOnError"
                            Devanathan Thirugnanam

                            I can connect to the Qlikbot and send msg to the admin using Admins ID. But i am still getting the error. It seems the error is from botClient.StartReceiving();

                             

                            The error message appear to be thrown in pair

                             

                            2018-04-16 16:00:25: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

                            2018-04-16 16:00:32: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

                            2018-04-16 16:00:32: logError BotOnReceiveError: Telegram.Bot.Args.ReceiveErrorEventArgs

                              • Re: QlikBotNet- "LogOnError"
                                Ruan Haese

                                The 2 errors are unrelated the one is because it does a check every 5 seconds,

                                some key isnt correct and so the check fails...I cant remember exactly how I fixed it.

                                (I got a bit frustrated with the whole bot so I just rewrote it, there's too many extra functionality in it.

                                I understand why they did it, you learn a lot but it gets to a point where its easier to rewrite things to apply to your

                                own situation).

                                 

                                As far as the keys go -100XXX is for a channel.  You sure though you want it to go to a channel?

                                That means every day if different people send a query ALL of them see the answer, which could be

                                very frustrating for some people. I prefer the one-on-one interaction of it.


                                Go through the Project step by step in debug mode check which values get sent through.

                                I'm sure its one of the key's or ID's are not correct if StartReceiving is also not working


                                Also an interesting read:

                                How to obtain the chat_id of a private Telegram channel? - Stack Overflow

                                  • Re: QlikBotNet- "LogOnError"
                                    Ruan Haese

                                    If your still struggling try opening a new project just with the Telegram code itself.

                                    Open a new project, add the Telegram nuget package and see

                                    if you can send & receive messages without all the other code running.

                                     

                                    If you need help with the code of setting that up then let me know.

                                     

                                    There are a couple of moving parts in this project, if your struggling with one part

                                    then just "divide & conquer"   

                                    Split the work so that you make sure each part works seperately.

                                     

                                    Hope that helps