Breezejs - get detailed error message in queries - entity-framework

I am working on an application with ASP.Net/MVC/EF/Breeze/Angular and it is working in my development environment. I just deployed it to my test environment and I am getting an error when I try to query breeze entity data. I don't think it's a DB connection problem, because I can query the breeze metadata successfully.
However, when I try to query for entity data, for example:
http://server/path/breeze/data/Cities
I get the following error:
{"$id":"1","$type":"System.Web.Http.HttpError, System.Web.Http","Message":"An error has occurred."}
This shows up as a 500 error in the browser network history. Is there any way to get Breeze to return a more detailed error message? I am not getting this error in development so I can't debug it there. Or any suggestions as to what I should look for if I can get metadata but not data?

Well, it turns out it was a connection string problem! I have no idea how breeze was generating metadata without a DB connection. Maybe it caches it in a local file?
Anyways, it would be nice to be able to get more detailed messages in cases like this. Since breeze returns IQueryable<T> I couldn't see any obvious way to catch the exception and send back a message myself...

Related

Appnexus-to-Azure data migration error (using sas)

i have a hourly data migration process which copies data from appnexus to Azure using sas key. But suddenly on 6/27/2020, 3:20:11 AM its stopped and started giving error "java.util.NoSuchElementException: An error occurred while enumerating the result, check the original exception for details.". Could someone help me to understand what has actually gone wrong.
You have not mentioned what is that you are using to copy the data , let me assume that its some kind of SPARK based system may azure databricks etc . I were you I could have started from the source side and if all looked good could have visted the drivers setup .
Please do share more info on this and we will try to get help.

Orientdb: Error executing live query subscriber

Orientdb throws on each live query subscripion using binary protocoll following Nullpointer exception:
Error executing live query subscriber. java.lang.NullPointerException at com.orientechnologies.orient.server.network.protocol.binary.OLiveCommandResultListener.onLiveResult(OLiveCommandResultListener.java:113)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLLiveSelect$2.call(OCommandExecutorSQLLiveSelect.java:134)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLLiveSelect.execInSeparateDatabase(OCommandExecutorSQLLiveSelect.java:144)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLLiveSelect.onLiveResult(OCommandExecutorSQLLiveSelect.java:131)
at com.orientechnologies.orient.core.query.live.OLiveQueryQueueThread.run(OLiveQueryQueueThread.java:69)
The Live Query is subscribed by one client: "live select from Account where CheckInDateTime like "2018-02-25%"", Orientdb returns also the live request token ID gracefully. But when another client updates Account with "update Account set CheckInDateTime = "2018-02-25 13:00:00"" the mentioned NullPointerexception is thrown. I've tried to use versions 2.2.30 and 2.2.32 Comunity, DB Administrator and Server Administrator accounts. Also loading of plugins seems not to work (even the used version is 2.2.30 and 2.2.32 where Live Query should be enabled at server by default). Nothing seems to help to get that work, also queries like "live select from account" (without where ...).
Any further ideas? Thx.
Currently live queries do not support the WHERE clause you included in the query.
You can only select entire collections or V and E (which is what I use to get all updates)
If you would like to filter using that where, you will have to write it yourself in code.
Thx for answering mitchken! Fortunately, I found the mistake. The TCP connection from client to DB was in wrong state (must be all the time in waitforreadyread).

BigQuery, tableUnavailable error while querying and streaming data into

I am trying to one of my BigQuery tables but I get this error:
Errors:
Something went wrong with the table you queried. Contact the table owner for assistance. (error code: tableUnavailable)
I used to be able to run the query until couple of hour ago without a problem and I still can query another table in a different data set.
I was also running a Python application to stream data into the this table, but now on:
table.insert_data(rows)
Causes this erro:
google.cloud.exceptions.ServiceUnavailable:
503 Error encountered during execution. Retrying may solve the problem.
(POST https://www.googleapis.com/bigquery/v2/projects/#myProjectId#/datasets/#myDatasetName#/tables/#myTableName#/insertAll)
I have read similar questions here but can't find any solution to this problem.
Here is the latest error jobId
"jobId": "bquijob_6491e032_15846c06c18"
This has been going for a while now, can anybody help?
This was a hopefully rare BigQuery incident:
https://status.cloud.google.com/incident/bigquery/18022

breeze breeze.EntityQuery.from('Agencies'); returns the last entity returned for entire results

Let me start by saying i'm new to breeze so I apologize if this turns out to be a stupid error on my side.
I'm using angular specifically John Papa's hot towel base. I have create a repository that returns back a list of agencies from a WebApi2 service (backed by EF6). This code actually seems to work fine if i break point the return of the breeze httpget the records returned show all the correct entity data and count.
The problem is when they are returned to my angular callback from "... .execute().then" the number if items is correct but all the entities appear to be the last entity returned from the webapi.
I am using local storage again John Papa's zStorage. but even if i by pass the local call and force just a remote it's the same result.
So any ideas and what code snippets are needed to help resolve this?
Thanks for any help you can provide.
It turns out the issue was an error in camelCasing between the database, server and client. Once I got the "Id" fields all in sync things started working properly.

Logging logic and data errors in MVC3 with Elmah

I have a Service layer in my MVC3 app, which plays the role of a Repository among other things, as a layer between my Data layer and the actual web application. I have coded all my GetById methods to be robust, using FirstOrDefault and not just First, because the Id is passed in a URL and cannot be guaranteed to be a valid Id.
I now find myself where I'm doing a FirstOrDefault, then only proceeding if the result is not null. I would like to log the event when it is null, and then proceed to do nothing etc. Now, I am already using Elmah to log unhandled exceptions, and I have very little experience with exception handling etc. in MVC3, but it occurs to me that it might be better for me to use a simple First, with Elmah logging the exception if no entity is found.
How should I approach this scenario, where an invalid Id is quite definitely an logic exception, but not a low level CLR exception? This is not like when somebody is asked to enter an Id and no entity is found for their search term, which is a normal logic result.
Generating exceptions can be expensive. You're initial approach of validating user input is more robust. I would recommend using a logging framework such as NLog (http://nlog-project.org) to log the case were an invalid ID is passed in.
If you would like to keep all of your log messages in Elmah, then you can decide to write directly to Elmah's error log instead of bubbling-up an exception.