Queries that involve more than 250 virtual entity lookup field values fail with "An unexpected error occurred." - dynamics-crm

I'm receiving this mysterious error message when using a custom virtual entity data provider:
{
"error": {
"code": "0x80040216",
"message": "An unexpected error occurred.",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey": "Plugin/Microsoft.Crm.ObjectModel.InsertLookupLogicalNamePlugin",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey": "ccb4d064-785c-eb11-a812-002248163c60",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey": "1",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey": "aac514e1-53ec-4ed9-9e47-d2643f0e92b1",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey": "System",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey": "System",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory": "SystemFailure",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMesageName": "UnExpected",
"#Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode": "400",
"#Microsoft.PowerApps.CDS.HelpLink": "http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040216&client=platform",
"#Microsoft.PowerApps.CDS.TraceText": "\r\n[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.InsertLookupLogicalNamePlugin]\r\n[ccb4d064-785c-eb11-a812-002248163c60: External plug-in implementation]\r\n\r\n",
"#Microsoft.PowerApps.CDS.InnerError.Message": "An unexpected error occurred."
}
}
It seems to occur more often with larger page sizes.
Plugin trace logs indicate the data provider ran successfully/no exception.

After some spelunking I found this error message in the on-prem server:
Query with entity reference to virtual entity can not exceed 250 limit. Please modify your query to reduce the number.
The limit appears to be unique lookup field values across the whole query. So in this example, if the results were as below:
Record
Lookup Column to Virtual Entity
Lookup Column to Virtual Entity
1
Value A
Value B
2
Value C
3
Value A
Value C
Would count as 3 towards the limit for that query.

Related

Cannot Parse The "search_phase_execution_exception" Into Go Structure *elastic.Error And Get The Root Cause

My department uses the olivere elastic v7.0.26 as ElasticSearch Client,sometimes our front-end system returns some errormsg such as "Error 400 (Bad Request): all shards failed [type=search_phase_execution_exception]" but doesn't have any other useful msg to help troubleshooting,so I've searched GitHub about parsing errors to *elastic.Error and codes are just like this:
if err != nil {
log.WithFields(ctx, log.Fields{}).WithError(err).Warn("list query es error")
if ex, ok := err.(*elastic.Error); ok {
log.WithFields(ctx, log.Fields{"query": query, "status": ex.Status, "detail": ex.Details}).WithError(ex).Warnf("list query es err")
}
return res, err
}
But the strange thing happened is "list query es error" was printed on our log system but the next log "list query es err" didn't,i've used deep-paging (large from+size) to check the log,it works and print the elastic error such as root cause so i can get the max_result_window tips..But it returns a unparsing error which is returned as the search_phase_execution_exception error,the company code is not allowed to paste to the open-sourcing website,and I just wanna know what error can make elasticsearch returns the search_phase_execution_exception and the errcode 400?Really appreciate your help!
same to above description,but the point I need to supple is that the problem is not always happened,so I can exclude the index mapping field type error such as "text/keyword",just wanna get the whole error/exceptions elasticsearch can return,but I cannot find the relative documentions on elastic guide,that's ok if u can provide the guide/doc about this
uhh it seems like a joke XD,I've never learned about some troubleshooting technique,but after I asked this question,I realized that I can get the ElasticSearch server log,so I asked our company's SRE and got the log,it's a error about terms query exceed maximum,and the reason caused is our RPC interface return a exceptional result about nil data redis set key,it will be a big-key problem,but we found this and fix it.

Sending a `create` RPC message to SurrealDB returns a "There was a problem with the database: The table does not exist" error

I'm debugging some tests for the .NET SurrealDB library. I can open connections to the database just fine but when I send a create RPC message to the db (docker container) it returns an error that reads "There was a problem with the database: The table does not exist"
TRACE tungstenite::protocol Received message {"id":"02B70C1AFE5D","async":true,"method":"create","params":["users",{"username":"john","password":"test123"}]}
...
16 13:46:45] DEBUG surrealdb::dbs Executing: CREATE $what CONTENT $data RETURN AFTER
surreal_1 | [2022-09-16 13:46:45] TRACE surrealdb::dbs Iterating: CREATE $what CONTENT $data RETURN AFTER
code: -32000, message: "There was a problem with the database: The table does not exist"
Any idea why that would happen? The table, of course, doesn't exist since I'm trying to create it. Would there be another reason in the Surreal code that such an error would be returned?
The error message was a red herring. The actual issue was that the client had an error that didn't allow it to sign in correctly so it wasn't authorized to make changes to the database.
Offending code:
// The table doesn't exist
Err(Error::TbNotFound) => match opt.auth.check(Level::Db) {
// We can create the table automatically
true => {
run.add_and_cache_ns(opt.ns(), opt.strict).await?;
run.add_and_cache_db(opt.ns(), opt.db(), opt.strict).await?;
run.add_and_cache_tb(opt.ns(), opt.db(), &rid.tb, opt.strict).await
}
// We can't create the table so error
false => Err(Error::TbNotFound), // Wrong Error Message
},
This has since been fixed and should now return a query permission error if the client is unauthorized.

Elasticsearch:: Filter by field size in bytes

I'm trying to reindex data from an old cluster to a new one
During the process I'm facing the following issue:
Validation Failed: 1: id is too long, must be no longer than 512 bytes but was: 532;
id here is a string field
a. My first attempt was to add "conflicts": "proceed" to the request body of reindex API. But that did not work and I faced same issue again
b. Then I tried to filter using below clause, idea was to delete them from old cluster:
doc['_id'].toString().getBytes().length > 512
But this fails due to below error:
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "dynamic method [java.lang.String, getBytes/0] not found"
}
Is there any other workaround for this?

Why do I get "storage decode error: input too short" error?

So I have a rust contract that has a storage mapper for an arbitrary value. I store it based on a identifier which is an u64.
#[view(getVersion)]
#[storage_mapper("someValue")]
fn get_value(&self, identifier:u64) -> SingleValueMapper<u64>
When I query this using the API or erdJs I always get
{
"statusCode": 400,
"code": "user error",
"message": "storage decode error: input too short"
}
What am I doing wrong?
So what I was doing wrong here was not the code of the contract itself but rather I was calling a query for a value that was not stored.
I was trying to reach a value that was not set in my case. For example I had these values
1 -> 100
2 -> 200
3 -> 300
5 -> 500
notice how identifier "4" does not have any reference stored. So I was trying to query this view for the identifier "4" and therefore I was getting a storage decode error because the storage was empty for that value.

XML Parsing Error : AJAX Chat

I am just trying to plant AJAX Chat for my website users. I have successfully completed the installation process with database configuration. But when I am trying to brows the domain.com/ajaxchat/index.php its returning this error given below:
XML Parsing Error: junk after document element Location: http://futurenext.esy.es/inc/chat/ Line Number 2, Column 1:
I think that the problem is in AJAXChatTemplate.php , and here the code is:
function getContent() {
if(!$this->_content) {
$this->_content = AJAXChatFileSystem::getFileContents($this->_templateFile);
}
return $this->_content;
And the error message is like:
" Non-static method AJAXChatFileSystem::getFileContents() should not be called statically, assuming $this from incompatible context in line 37"
Now please any one can help me to fix the problem. What is the problem here I can't really understand. Thanks.

Resources