We are developing Silverlight web application to display the tweets on the map and analyse the tweets by using sentiment API. we used sentiment API without problems for 3 or 4 weeks. Then, we sometimes faced TargetInvocationException after calling sentiment API
Now, we face TargetInvocationException after calling sentiment API more and more.
XDocument newdoc = XDocument.Parse(en.Result);
en.Result become null and
the exception is shown :
System.Reflection.TargetInvocatinException : An exception occurred during the operation, making the result invalid. Check InnerExcepton for exception details. --->
System.Net.WebException: The remote server returned an error: NotFound ---> System.Net.WebException : The remote server returned an error: NotFound.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult ayncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplalyClass4.b__1(Object sendState)
---End of inner exception stack trace
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult ayncResult)
at System.Net.WebClient.GetWebResponse(WebRequest, IAsyncResult result)
at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
---End of inner exception stack trace
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at System.Net.DownloadStringCompletedEvent Args.get_Result()
at SilverlightApplication1.MainPage.<>c_DisplayClass1a.<>c_DisplayClass23.b__16(Object ss, DownloadStringCompletedEventArgs en)
I faced this exception when I had a data contract class which had a property of type Enum. Then I decorated the DataContract with [KnownType (typeof(MyEnum))]. I did not see this exception after that.
Related
I started this process back in November with this question: How to migrate an existing SSRS setup to a new server?
I was able to migrate everything to the new server without any issues. There were no errors on any of the tabs in the Report Server Configuration Manager. And the Reporting Service started with out errors. I was able navigate the expected "directory" structure through the web interface. However, when I tried to execute a report, upload a report or manage the report I received an error dialog that read "An error has occurred. Something went wrong. Please try again later." This isn't the most helpful error, so I went to the Report Service error log and found this exception in the log:
Microsoft.ReportingServices.Portal.WebHost!reportserverwebapp!4a!03/02/2019-12:44:39:: e ERROR: [c4tdsgh8]: OData exception occurred: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:443
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.SqlServer.ReportingServices2010.ReportingService2010.IsSSLRequired()
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SetConnectionProtocol()
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SoapMethodWrapper`1.ExecuteMethod(Boolean setConnectionProtocol)
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SoapMethodWrapper`1.ExecuteMethod()
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SetItemDefinition(String itemPath, Byte[] definition, Property[] properties)
at Microsoft.ReportingServices.Portal.Services.SoapProxy.SoapRS2010Proxy.<>c__DisplayClass14.<SetItemDefinition>b__13()
at Microsoft.ReportingServices.Portal.Services.SoapProxy.SoapAuthenticationHelper.ExecuteWithWindowsAuth[TReturn](SoapHttpClientProtocol soapClient, IPrincipal userPrincipal, Func`1 func)
at Microsoft.ReportingServices.Portal.Services.SoapProxy.SoapAuthenticationHelper.ExecuteWithCorrespondingAuthMechanism[TReturn](SoapHttpClientProtocol soapClient, IPrincipal userPrincipal, Func`1 func)
at Microsoft.ReportingServices.Portal.Services.SoapProxy.SoapRS2010Proxy.SetItemDefinition(IPrincipal userPrincipal, String itemPath, Byte[] definition, Property[] properties)
at Microsoft.ReportingServices.Portal.Repositories.CatalogItemRepository.UpdateReport(IPrincipal userPrincipal, String origItemPath, Report item, Boolean renameOrMove, String[] delta)
at Microsoft.ReportingServices.Portal.Repositories.CatalogItemRepository.Update(IPrincipal userPrincipal, Guid key, CatalogItem catalogItem, String[] delta)
at Microsoft.ReportingServices.Portal.ODataWebApi.V1.Controllers.CatalogItemsController.PutEntity(String key, CatalogItem entity)
at Microsoft.ReportingServices.Portal.ODataWebApi.V1.Controllers.Reflection.EntitySetReflectionODataController`1.Put(ODataPath oDataPath, T value)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext().
I spent a few hours looking this error up with no solution. It could be that I was pretty fried and I missed something, but any guidance would be appreciated.
You may find its faster to create a SSRS project in SSDT, import the reports and redeploy them. You may have to recreate the data sources but in my experience this is the fastest way to get it done.
I was playing with ActiveDirectoryClient to call ADGraph APIs, and I found out that it is throwing System.Data.Services.Client.DataServiceQueryException on my local machine (wrapped within an Exception), but it is throwing Microsoft.Data.OData.ODataErrorException on one of our deployed service instead.
I cannot find any Documentation regarding what exceptions ActiveDirectoryClient is supposed to throw, and how we are supposed to handle exceptions given this erratic behavior.
I looked at the de-compiled code, and it seems like this is due to namespace conflict between System.Data.Services.Client vs. Microsoft.Data.Services.Client, but I am not 100% sure.
Can anyone help me understand which type of exceptions are ActiveDirectoryClient supposed to throw, and why this is throwing different kinds of exceptions depending on environment?
Here is the example stacktrace between two:
Microsoft.Data.OData.ODataErrorException: Insufficient privileges to complete the operation. ---> System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."}}}
at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper.<>c__DisplayClass4c`2.<ExecuteAsync>b__4a(IAsyncResult r)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
vs.
System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: {"odata.error":{"code":"Authorization_RequestDenied","message":{"lang":"en","value":"Insufficient privileges to complete the operation."},"requestId":"babeee64-a5b1-4b37-9124-a3e18cc304fb","date":"2018-06-12T04:22:53"}}
at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Data.Services.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery`1.EndExecute(IAsyncResult asyncResult)
at Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.DataServiceContextWrapper.<>c__DisplayClass4c`2.<ExecuteAsync>b__4a(IAsyncResult r)
In both your exception there is very clear message:
{"lang":"en","value":"Insufficient privileges to complete the operation."}
You do not have enough privileges to complete the operation. So consult the graph API regarding the operation you try to accomplish, what privileges does it require and if you have granted those to your application.
Also take a note that if you are using just client credentials flow you will not be able to delete any objects from your directory. The applications (service principals) aren't allowed to delete anything. You can also overcome this, but you do not want to do that. The way to make application capable of deleting objects, is to make it company administrator. That means, anyone who got your client credentials (client_id, client_secret) will have full control of your Azure AD. And you do not want that.
I've been experiencing some odd issues with my application that I am not sure how to go about tracking down because it is so random. I was wondering if there may be any ideas based on the stack trace below.
Here is some quick bullet points:
Issue seems to be related to code in the View (.cshtml)
It RANDOMLY appears and it has something to do with the session cookie because if you try from another computer then it is no issue or if you clear your cache it is no issue
My GetUserByIdentifier is wrapped in a try{}catch{} which returns NULL if we enter the catch{}.. which should redirect to the login screen.
Could this be something internal causing the error message? This unhandled exception can even happen on my login.cshtml page which doesn't even have any code in the view.
The error message:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +72
System.SZArrayHelper.get_Item(Int32 index) +13816967
Nancy.ViewEngines.Razor.RazorViewEngine.GetLineNumber(Int32 startLineIndex, IReadOnlyList`1 compilationSource) +39
Nancy.ViewEngines.Razor.<>c__DisplayClass19_0.<BuildErrorMessages>b__0(Diagnostic error) +118
System.Linq.WhereSelectArrayIterator`2.MoveNext() +80
System.Linq.WhereEnumerableIterator`1.MoveNext() +51
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +250
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +106
Nancy.ViewEngines.Razor.RazorViewEngine.BuildErrorMessages(IEnumerable`1 errors, IList`1 templateLines, IReadOnlyList`1 compilationSource) +272
Nancy.ViewEngines.Razor.RazorViewEngine.BuildErrorMessage(EmitResult result, ViewLocationResult viewLocationResult, String sourceCode) +366
Nancy.ViewEngines.Razor.<>c__DisplayClass14_0.<GenerateRazorViewFactory>b__0() +49
Nancy.ViewEngines.Razor.RazorViewEngine.GetViewInstance(ViewLocationResult viewLocationResult, IRenderContext renderContext, Object model) +1064
Nancy.ViewEngines.Razor.<>c__DisplayClass9_0.<RenderView>b__0(Stream stream) +4700
Nancy.Hosting.Aspnet.<ProcessRequest>d__2.MoveNext() +381
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +13891908
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +61
System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +69
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +178
When I configure the workflow. I have got an error message like that.
System.Management.Automation.CmdletInvocationException: The user name
'user#domain' is invalid. ---> System.ArgumentException: The
user name 'user#domain' is invalid. at
System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord
errorRecord) --- End of inner exception stack trace --- at
System.Management.Automation.Runspaces.AsyncResult.EndInvoke() at
System.Management.Automation.PowerShell.EndInvoke(IAsyncResult
asyncResult) at
Microsoft.Workflow.Deployment.ConfigWizard.CommandletHelper.InvokePowershell(Command
command, Action3 updateProgress) at
Microsoft.Workflow.Deployment.ConfigWizard.CommandletHelper.CreateDefaultNamespace(String
sbnamespace, String[] managedUsers, Action3 updateProgress) at
Microsoft.Workflow.Deployment.ConfigWizard.ProgressPageViewModel.NewSBNamespace(FarmCreationModel
model, Boolean errorOnFailure, Boolean isFirstCommand)
I've tried to research but don't get anything. Please help!
I have a few Silverlight applications in my website. Each are on their own page and do not interact with each other. I'm using Silverlight 5 and WCF Data Services for data access.
IE has been working great, but when I switch between the two while the first one is in the middle of getting data from the WCF Data Service (or we also have a .aspx page that is serving up xml in the code behind and it happens there as well).
It's throwing some seemingly random exceptions and I'm not sure how to handle them. Any ideas on how to avoid these, or cancel calls when the url changes in FF?
Chrome reports my WCF Data Service webget request as canceled and undefined.
Here's a list of what I've captured so far:
{System.InvalidOperationException: Failed to Invoke: callOpen.
at System.Windows.Browser.ScriptObject.Invoke(String name, Object[] args)
at System.Data.Services.Http.ScriptObjectUtility.CallOpen(ScriptObject request, String method, String uri)
at System.Data.Services.Http.ScriptXmlHttpRequest.Open(String uri, String method, Action readyStateChangeCallback)
at System.Data.Services.Http.XHRHttpWebRequest.InvokeRequest()
at System.Data.Services.Http.XHRHttpWebRequest.BeginGetResponse(AsyncCallback callback, Object state)
at System.Data.Services.Client.BaseAsyncResult.InvokeAsync(Func3 asyncAction, AsyncCallback callback, Object state)
at System.Data.Services.Client.QueryResult.BeginExecute()
at System.Data.Services.Client.DataServiceQuery1.BeginExecute(AsyncCallback callback, Object state)
.....
HttpWebResponse.NormalizeResponseStatus....
{System.InvalidOperationException: get_BrowserInformation failed.
at System.Windows.Browser.HtmlPage.get_BrowserInformationInternal()
at System.Windows.Browser.HtmlPage.get_BrowserInformation()
{System.InvalidOperationException: An error occurred while processing this request. ---> System.Data.Services.Http.WebException: Internal error at 'HttpWebResponse.NormalizeResponseStatus'.
at System.Data.Services.Http.XHRHttpWebResponse.NormalizeResponseStatus(Int32& statusCodeParam)
at System.Data.Services.Http.XHRHttpWebResponse..ctor(XHRHttpWebRequest request, Int32 statusCode, String responseHeaders)
at System.Data.Services.Http.XHRHttpWebRequest.CreateResponse()
at System.Data.Services.Http.XHRHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Data.Services.Client.QueryResult.AsyncEndGetResponse(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)
at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceRequest.EndExecute[TElement](Object source, DataServiceContext context, IAsyncResult asyncResult)
at System.Data.Services.Client.DataServiceQuery1.EndExecute(IAsyncResult asyncResult)
at DataService.<>c__DisplayClass61.b__1(IAsyncResult iar)}
Firebug is showing:
Firebug:
attempt to run compile-and-go script on a cleared scope
Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.open]
[Break On This Error]
...ge to get source for: http://localhost/Visiconn/Pages/Administration/ViewDisplay...
[System.Data.Services.Http.WebException] = {System.Data.Services.Http.WebException: Internal error at 'ScriptXmlHttpRequest.CreateNativeRequest'.
at System.Data.Services.Http.ScriptXmlHttpRequest.CreateNativeRequest()
at System.Data.Services.Http.XHRHttpWebRequest.InvokeRequest()
at Syst...