Why do I get the following error when I try to edit message in group: ETELEGRAM: 400 Bad Request: message to edit not found? - telegram-bot

Edit functionality works properly in private chat, but doesn't work in group chat. What might be the reason of that behaviour?
I am getting the following error:
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: message to edit not found
at project\node_modules\node-telegram-bot-api\src\telegram.js:291:15
at tryCatcher (project\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (project\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (project\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (project\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (project\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (project\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (project\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (project\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (project\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:464:21)
There's no need to see my code because as I said before it works fine in private chat. So there might be some group-specific thing that I am now aware of. Maybe I have to configure group or the bot.
Message ID is 100% correct. Message belongs to the bot.
Bot has access to the group messages. Message is not expired.
Thank you!

When you intent to send message to GROUPs the ID must come with a -
like with you chatid on group is 789456789 the id will be -789456789

Related

Debugging "Transaction simulation failed" when sending program instruction (Solana Solidity)

When attempting to make a call to a program compiled with #solana/solidity, I'm getting the following error:
Transaction simulation failed: Error processing Instruction 0: Program failed to complete
Program jdN1wZjg5P4xi718DG2HraGuxVx1mM7ebjXpxbJ5R3N invoke [1]
Program log: pxKTQePwHC9MiR52J5AYaRtSLAtkVfcoGS3GaLD24YX
Program log: sender account missing from transaction
Program jdN1wZjg5P4xi718DG2HraGuxVx1mM7ebjXpxbJ5R3N consumed 200000 of 200000 compute units
Program failed to complete: BPF program Panicked in solana.c at 285:0
Program jdN1wZjg5P4xi718DG2HraGuxVx1mM7ebjXpxbJ5R3N failed: Program failed to complete
jdN1wZjg5P4xi718DG2HraGuxVx1mM7ebjXpxbJ5R3N is the program's public key and pxKTQePwHC9MiR52J5AYaRtSLAtkVfcoGS3GaLD24YX is the sender's public key.
I'm using a fork of the #solana/solidity library that exposes the Transaction object so that it can be signed and sent by Phantom Wallet on the front end. The code that results in the error is as follows:
// Generate the transaction
const transaction = contract.transactions.send(...args);
// Add recent blockhash and fee payer
const recentBlockhash = (await connection.getRecentBlockhash()).blockhash;
transaction.recentBlockhash = recentBlockhash;
transaction.feePayer = provider.publicKey;
// Sign and send the transaction (throws an error)
const res = await provider.signAndSendTransaction(transaction);
I would attempt to debug this further myself, but I'm not sure where to start. Looking up the error message hasn't yielded any results and the error message isn't very descriptive. I'm not sure if this error is occurring within the program execution itself or if it's an issue with the composition of the transaction object. If it is an issue within the program execution, is there a way for me to add logs to my solidity code? If it's an issue with the transaction object, what could be missing? How can I better debug issues like this?
Thank you for any help.
Edit: I'm getting a different error now, although I haven't changed any of the provided code. The error message is now the following:
Phantom - RPC Error: Transaction creation failed. {code: -32003, message: 'Transaction creation failed.'}
Unfortunately this error message is even less helpful than the last one. I'm not sure if Phantom Wallet was updated or if a project dependency was updated at some point, but given the vague nature of both of these error messages and the fact that none of my code has changed, I believe they're being caused by the same issue. Again, any help or debugging tips are appreciated.
I was able to solve this issue, and although I've run into another issue it's not related to the contents of this question so I'll post it separately.
Regarding my edit, I found that the difference between the error messages came down to how I was sending the transaction. At first, I tried sending it with Phantom's .signAndSendTransaction() method, which yielded the second error message (listed under my edit). Then I tried signing & sending the transaction manually, like so:
const signed = await provider.request({
method: 'signTransaction',
params: {
message: bs58.encode(transaction.serializeMessage()),
},
});
const signature = bs58.decode(signed.signature);
transaction.addSignature(provider.publicKey, signature);
await connection.sendRawTransaction(transaction.serialize())
Which yielded the more verbose error included in my original post. That error message did turn out to be helpful once I realized what to look for -- the sending account's public key was missing from the keys field on the TransactionInstruction on the Transaction. I added it in my fork of the #solana/solidity library and the error went away.
In short, the way I was able to debug this was by
Using provider.request({ method: 'signTransaction' }) and connection.sendRawTransaction(transaction) rather than Phantom's provider.signAndSendTransaction() method for a more verbose error message
Logging the transaction object and inspecting the instructions closely
I hope this helps someone else in the future.

Unhandled rejection Error: Chrome still being created

When I use { insertDefaultUI: false } to create a video I get an "Unhandled rejection Error: Chrome still being created" when trying to cleanup after I'm done with session.disconnect().
Any ideas...?
I'm on the TokBox dev team.
The error is not something you should be concerned with, it's something internal to the SDK.
The bug is that the error is appearing at all. I have created a bug report and this error should disappear in a future release. Until then you can safely ignore it.
Thanks for the report.
I'm having the very same problem when trying to unpublish my publisher
Could you guys provide a solution?
Unhandled rejection Error: Chrome still being created
at Object.chromeMixin.reset (https://static.opentok.com/v2/js/opentok.js:41755:16)
at reset (https://static.opentok.com/v2/js/opentok.js:42837:19)
at Publisher.destroy (https://static.opentok.com/v2/js/opentok.js:43211:7)
at defaultAction (https://static.opentok.com/v2/js/opentok.js:43524:20)
at executeDefaultAction (https://static.opentok.com/v2/js/opentok.js:25584:19)
at Object.api.dispatchEvent (https://static.opentok.com/v2/js/opentok.js:25735:7)
at Publisher.self.dispatchEvent (https://static.opentok.com/v2/js/opentok.js:25427:19)
at Object.streamDestroyed (https://static.opentok.com/v2/js/opentok.js:43527:16)
at Object.unpublishFromSession (https://static.opentok.com/v2/js/opentok.js:43507:16)
at Session.unpublish (https://static.opentok.com/v2/js/opentok.js:47031:19)
at Object.me.stop (https://x/rt.js:498:17)
at b.$scope.callBreak (https://x/ler.js:16:24)
at fn (eval at compile (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:239:266), <anonymous>:4:165)
From previous event:
at createChromeMixin (https://static.opentok.com/v2/js/opentok.js:41672:21)
at new Publisher (https://static.opentok.com/v2/js/opentok.js:42826:23)
at Object.initPublisher (https://static.opentok.com/v2/js/opentok.js:44275:21)
at Object.me.start (https://x/rt.js:457:27)
at b.$scope.start (https://x/ler.js:6:24)
at fn (eval at compile (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:239:266), <anonymous>:4:161)
at e (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:284:187)
at b.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:148:347)
at b.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:149:52)
at HTMLButtonElement.<anonymous> (https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js:284:239)
at HTMLButtonElement.dispatch (https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js:4:8549)
at HTMLButtonElement.r.handle (https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js:4:5252)
I might be a bit late, but I'll share my findings. When using a custom UI on your publisher, use the following event:
publisher.on('streamDestroyed',function(event){ event.preventDefault();});
This disallows opentok calling widget destroying events which causes the exception related to this question, however now I don't know how to stop the stream lol, since if I call event.target.destroy() will generate the same exception, lol ... so I'm trying to figure that out.

Splunk rex query does not return desired result

I am looking to search for error type in my spunk. A typical error log looks like this:
ERROR 2016/03/16 22:13:55 Program exited with error Calling service: Post http://hostname/v1.21/resource/create?name=/60b80cf9-ebc4-11e5-a9cb-3c4a92db9491-2: read unix #->/var/run/program.sock: use of closed network connection (Client.Timeout exceeded while awaiting headers)
Note that common part is "Program exited with error". I am looking to capture the part that follows this common part of the error message. I tried with a couple of rex expressions. Both returned different results. Importantly, neither captured the error type I have shown above. I am giving the one that worked better here.
* | rex "Program exited with error\s+(?<reason>.+)" | top reason
An example of the log it matched-
Unable to get program status, Get http://192.168.0.2:2774/program/v1/status: net/http: timeout awaiting response headers
However, it did not match log of the form-
initial ZK connection failed, stat /var/program/f47aae5c-ea42-11e5-8975-fc15b40f4cc4/srcheck/started: no such file or directory
Calling service: Post http://hostname/v1.21/resource/create?name=/60b80cf9-ebc4-11e5-a9cb-3c4a92db9491-2: read unix #->/var/run/program.sock: use of closed network connection (Client.Timeout exceeded while awaiting headers)
Could someone help me understand what's wrong with my rex expression and what the right one would be so I get all possible error types?
This recipe:
"ERROR.*Program exited with error.*:.*:.*:\s+(?<reason>.+)"
will yield:
use of closed network connection (Client.Timeout exceeded while awaiting headers)
I don't have enough sample data to know if this will hold up or not. For example, I'm counting on exactly 3 colons, to get me to the interesting part. Also I don't know if you care about other things like the hostname, the fact that it's a Post, etc.. But based on your sample of 1, this answer should do the trick.

How to make Xlib print error message, but not exit?

"The action of the default handlers is to print an explanatory message and exit." (link)
Example of such message:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 12 (X_ConfigureWindow)
Resource id in failed request: 0xc0007a
Serial number of failed request: 140
Current serial number in output stream: 141
If I set (XSetErrorHandler) my own "ignore everything" error handler, the "explanatory messages" disappear.
How to make Xlib ignore errors, but still print error messages?
If you actually want those error messages you pretty much have two options:
Pull _XPrintDefaultError out of XlibInt.c along with some private headers (with all the caveats of using library-private definitions).
Redefine exit() not to actually exit when _XDefautError calls it.
Neither is especially pretty and both may break and reduce your portability, but they do work.
You have to format your own message. The contents of the message is the contents of the XErrorEvent struct:
http://tronche.com/gui/x/xlib/event-handling/protocol-errors/default-handlers.html

Splunk Error Log Dashboard

I've to create a dashboard in splunk which will show error reporting within the log file:
[2011-09-12 14:13:00:605 GMT][com.abc.rest.Security][http-8080-Processor15] ERROR Unable to decrypt token [abc.com=3502639832.36895.0000; path=/] due to error: Input length must be multiple of 16 when decrypting with padded cipher
[2011-09-12 14:13:00:608 GMT][com.abc.filters.AuthenticationFilter][http-8080-Processor15] DEBUG ValidAuthToken: false
[2011-09-13 16:43:40:134 GMT][com.abc.PerfManager][http-8080-Processor13] ERROR Operation Failed: GET_ACCOUNT_ORDER [Status Code: 0150 Message: ACCESS_DENIED]
[2011-09-13 16:43:40:137 GMT][com.abc.rest.ResolvePackage][http-8080-Processor13] WARN MCE error occurred [StatusCode: 0150].
The above errors are occurring at different times & I want to count those all & show pie chart of all these errors with their count. Basically, these errors could be anything which starts with ERROR.
I should also get the Top10 warnings in the logs with their count.
I couldn't find a good way to implement it in Splunk. Can any one help me out on how to implement it in splunk?
Thanks!
... | rex "ERROR (?<error_type>[^\[]+)" | stats count by error_type
something like that should work. check our http://splunk-base.splunk.com/answers/ if it doesn't work.