Unfortunately I have a problem with the discord.net libraries. basically when I try to delete a message from the 'message_receive_event' event by doing message.DeleteAsync() Discord outputs this error message Log: 18:40:16 Gateway A MessageReceived handler has thrown an unhandled exception.: Discord.Net.HttpException: The server responded with error 403: Forbidden in Discord.Net.Queue.RequestBucket.<SendAsync>d__18.MoveNext(). I have already tried several times a solution among the many forums and documents of discord.net, but nobody seems to have encountered a problem like mine. If you need to watch the code to solve the problem: https://github.com/carpall/dalvikbot
As said by Anu6is, the bot does not have permissions to delete the message. When your bot joined your server it gave it a role that is named after your bots name. Make sure to go into your role settings and give it administrator perms. I am kinda late but hoping I can help the people who search for the same issue in the future.
Related
UPDATE: This turned out to be simple operator error - I failed to read the log file properly, which did indicate successful delivery on the IIS level.
Turns out that mails to this particular test address were blocked silently for unknown reasons unrelated to dotnet or IIS, by Gmail. Very sorry for posting something with such a simple solution and thanks to those that replied with helpful advice.
ORIGINAL QUESTION:
I have a Windows server with IIS SMTP server installed.
I'm trying to send mails from my ASP.NET Core app with this code:
var client = new SmtpClient();
client.Host = "127.0.0.1";
client.Send(mailMessage);
The code doesn't throw an exception, there is nothing in Windows error logs, nothing is logged to SMTP logs. It just fails silently.
The result of the Send() method is just the message itself, no error message or anything else helpful.
I tried in IIS to configure the SMTP Server but doesn't help.
I also tried other options like UseDefaultCredentials and to have it make a file in the Drop folder - in that case it says "not supported."
This exact same code works perfectly fine from my ASP.NET Standard app on the same server.
Thanks in advance! :-)
This turned out to be simple operator error - I failed to read the log file which indicated successful delivery on the IIS level. The mails to this particular test address were blocked silently for unknown reasons by Gmail. Very sorry for posting something with such a simple solution and thanks to those that replied with helpful advice.
Here's the gist of my issue. I have a C# program that is calling several PowerShell cmdlets.
All the calls work, except when I get to "Connect-AzureAD -TenantId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
But the way it "fails" is odd. It only lets me enter my Microsoft Account, but not the password. IF I RUN IT AGAIN, I can log in correctly and it works.
I thought I was hitting a timeout of some kind, but each call bellow results in a Null Reference Exception. You can see my comments of frustration.
// All of these are set to null...so what gives?
// all generate NRE's
//Debug.Print("MaxIdle Timeout is |{0}|", runspace.ConnectionInfo.MaxIdleTimeout.ToString());
//Debug.Print("Current Idle Timeout is |{0}|", runspace.ConnectionInfo.IdleTimeout.ToString());
//Debug.Print("Operation Timeout is |{0}|", runspace.ConnectionInfo.OperationTimeout.ToString());
Thoughts, ideas, comments?
I can post more of the code, if needed, but everything else works all the time.
Per a comment, I added a CR, but it appeared to do nothing (I will try a CR+LF, because I have no idea what's actually broken here, so there's no harm in trying).
So...after the PowerShell invoke call, I collect the results as follows:
foreach (PSObject outputObject in results)
and my results collection has these four errors in it:
{One or more errors occurred.: The browser based authentication dialog failed to complete. Reason: The server or proxy was not found.}
{One or more errors occurred.}
{ The browser based authentication dialog failed to complete. Reason: The server or proxy was not found.}
{One or more errors occurred.: The browser based authentication dialog failed to complete. Reason: The server or proxy was not found.}
It's telling me what I already know (that auth didn't work), but I'm still clueless as to what the actual issue is.
Adding some more detail
So...I've tried a few things. I added my Microsoft account to the connect. The result was even more odd -- a long delay, no password screen, and failure to log in.
Then I pivoted to setting up an application principal as detailed here: "Using a Service Principal to connect to a directory in PowerShell" https://learn.microsoft.com/en-us/powershell/azure/active-directory/signing-in-service-principal?view=azureadps-2.0
I got it all set up and verified in PowerShell that I can connect, then I placed the exact same (I copied and pasted it) Connect-AzureAD with the tenant, application ID, and certificate thumbprint that I used in PowerShell. It failed with these "new" errors -- still four somehow:
One or more errors occurred.
An error occurred while sending the request.
The remote name could not be resolved: 'login.microsoftonline.com'
One or more errors occurred.
Tomorrow, I'll fire up Wireshark. I'm getting the feeling that these errors are all misleading, although the fact that it works on the second try is just mind boggling.
since yesterday evening i've a problem with my "express-checkout API"
Every time if I called the uri
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-0W349......
I get the error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#paypal.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Yesterday in the morning everything was ok and since I didn't change anything also nothing on the API class.
My Server support the sha256 and the protocol Tls12.
I've nothing in the Logfile from server.
The Live environment works fine but the sandbox environment doesn't work since yesterday.
Is it an error on paypal site or on my side?
I've send also a mail to paypal but I get an autoresponse Message.
Please help me and sry for my bad english.
Thanks and best regards.
This may be related to the recent sandbox downtime over the past 24 hours or so. The problem was diagnosed by the team and they were able to repair the problem. Can you check again to see if it's working now please?
I've seen loads post on this forum about exchange API, but I've never found something like I have.
I' m trying to connect to Exchange using Exchange API in order to get all room's meetings.
My problem : Sometimes, it's working, I can connect and get all my informations. And 5m later, impossible to connect. I got Unauthorized.
It's not an error on code because it's working, I think it's a problem with exchange server, but I really don't know what it is...
On the next picture, there are traces.
On the left, when it's working, And the same 30m later (same identification, same room) which is not working.
http://hpics.li/2d9b216
If you have any ideas ? I really don't know what to do.
thanks (and sorry for my english !)
I notice that the working request comes from server A (look at the value of X-FEServer header), and the failing one comes from server B. Perhaps there is a configuration problem on server B.
thx for this.
I've done some tests : I've modified my host file in my computer. when the url is pointing to serveur A, it's working. When it's on the other server, not working. It's the same configuration on both, cannot find what's wrong. So I will conserve my actual host file (pointing always on serveur A).
This is the second time I got following error for my website:
Warning: Fatal error 9001 occurred at May 5 2012 1:16AM. Note the
error and time, and contact your system administrator.
I get this error while login to website. However, there is no any problem for connecting database or fetching records.
Last time I just took a backup and restore my database then this issue was resolved. But, I got again similar issue, now I want to know exact cause for this error.
I appreciate your reply.
Check SQL Server logs, seems to be an issue with log being full. "Last time I just took a backup and restore my database then this issue was resolved." seems to be database related. Check https://serverfault.com/questions/238394/diagnosing-microsoft-sql-server-error-9001-the-log-for-the-database-is-not-avai.