Unknown column 'Extent1.Discriminator' in 'where clause' - mysql

I am using Visual Studio 2013 web form application with MySql database to build a web form application but I have been unable to get past 'Membership and Role Management'.
I used a database first approach for the membership and when I try registering a new user, I get the error message below:
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: MySql.Data.MySqlClient.MySqlException: Unknown column 'Extent1.Discriminator' in 'where clause'
Source Error:
Line 16: var manager = new UserManager();
Line 17: var user = new ApplicationUser() { UserName = UserName.Text };
Line 18: IdentityResult result = manager.Create(user, Password.Text);
Line 19: if (result.Succeeded)
Line 20: {
Source File: c:\WebsiteProjects\ASPNETWebProjects\RevenuePortal\RevenuePortal\Account\Register.aspx.cs
Strangely, I do not have an 'Extent1.Discriminator' column anywhere in the database and cannot understand the reason for this frustrating error.

Extent1 is a table alias used by entity framework when it constructs the underlying sql statements. The error means that EF is either not configured correctly or misinterprets your database structure.
You need to analyise the underlying query it generates and determine why EF us3s a field it is not supposed to. Probably a relationship between 2 tables is incorrectly set up.

if possible try to do migration from beginning. from below execution in Nuget package manager:VS 2019 - Tools - NuGet Package Manager - Package Manager Console - run command Add-Migration DBInit - once done, run another command Update-Database.
Above solution is for code first approach.
I had same issue when I changed my system, After did migration it started working for me. Hope same will work for others. happy programming!!

Related

deploySandboxInstance() error while creating a sandbox instance in MySQL

We are performing HA InnoDb in Mysql. For that we need 3 instance to perform failover.
While running this query in msql-js we got an error of invalid object member.
Query - dba.deploySandboxInstance(3310);
Error - Invalid object member deploySanboxInstance (AttributeError)
The error message is clear: Invalid object member deploySanboxInstance (AttributeError)
The function is named "deploySandboxInstance".
Note that sandboxes are not suitable for production environments and should be used for testing purposes only.
Please read the user guide as it contains all the information you're looking for:
https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-userguide.html

Creating classes in pimcore

I'm new to the whole pimcore thing. I am trying to play around and create classes. The issue is, I am not able to create more than 1 class, and in the database it is nameless, so when I try to create another class, it also tries to store it in the database with no name, which ends up showing an SQL error saying that there is a duplicate entry. Any ideas what the reason behind this could be?
I installed pimcore on an nginx server, I am trying to create classes by choosing Settings->Objects->Classes and then "Add Class", creating the first class was ok, I entered a name for the class and it was successfully added, however the name field in the corresponding database entry is empty, as in empty string ' '. So, when I try to add another class and pimcore attempts to store it in the table "classes", it returns an error saying that it would be a duplicate entry since they both are nameless, i.e. the name entered isn't added. The following error is what I managed to find using developer tools, could be helpful.
[WARN] Unable to parse the JSON returned by the server
minified_javascript_core_f5757da….js?_dc=3708:5684 Error: You're trying to decode an invalid JSON String:
Fatal error: Call to a member function hasChilds() on null in /var/www/html/pimproject/pimcore/modules/admin/controllers/DocumentController.php on line 59
at new Ext.Error (http://192.10.0.0/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:27054)
at Function.Ext.apply.raise (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:27447)
at Object.Ext.raise (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:27594)
at Object.Ext.JSON.me.decode (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:385102)
at Ext.define.onProxyLoad (http://192.10.0.10/website/var/tmp/minified_javascript_core_f5757da9fa29d5bf13e6aa5058eff9f7.js?_dc=3708:5641:28)
at Ext.cmd.derive.triggerCallbacks (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:594533)
at Ext.cmd.derive.setCompleted (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:594231)
at Ext.cmd.derive.setException (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:594444)
at Ext.cmd.derive.process (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:593638)
at Ext.cmd.derive.processResponse (http://192.10.0.10/pimcore/static6/js/lib/ext/ext-all.js?_dc=3708:22:648303)
Just reinstall Pimcore.
It can be some composer or submodules error.
I strongly recommend for the first installation to run Demo project https://github.com/pimcore/demo not Skeleton, especially if you are using Docker. Later, when you will get the feeling of Pimcore, feel free to install Skeleton or any other project.
Pimcore is stable working for years. If you had some problems before -- nowadays, it is stable.

OpenERP pentaho report error : Failed at query

I am getting an error while I try to generate a report from OpenERP.
File "/home/target/projects/orthene/pentaho_reports/wizard/report_prompt.py", line 207, in _setup_parameters
report_parameters = proxy.report.getParameterInfo(proxy_argument)
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
Fault: <Fault 0: 'Failed to invoke method getParameterInfo in class com.willowit.reporting.PentahoRenderer: Failed at query: SELECT name FROM res_partner WHERE customer=True'>
Here is how my pentaho report design looks like:
The pentaho report designed version is 5.0.1-Stable
It is a JDBC connection with my local postgres database connection, which is a successful connection in report designer.
select_partner is a SQL query that fetches all the partner names to show in parameter.
SELECT name FROM res_partner WHERE customer=True
PartnerQuery is a SQL query that fetches name,city,phone & email of customers
SELECT name,city,phone,email FROM res_partner WHERE customer=True AND name=${partner} // ${partner} is a parameter defined
partner parameter is containing drop down selection of partners when we generate a report, it includes 2 point partner_query(which lists down all the partners)
![enter image description here][2]
Report is working fine in Pentaho report designed & give output like this:
But it is not working in OpenERP & getting an error as described on the very top.
Keyur, I recommend that you post it on github page of WillowIT or this pentaho module.
Here is what I found https://github.com/WillowIT/Pentaho-reports-for-OpenERP/issues/125.
Is this query returning NULL?
There was a wrong value of pentaho.postgres.password in OpenERP Settings->Technical->Parameters->System Parameters.
This issue was solved after applying correct password.
The error
Fault 0: 'Failed to invoke method getParameterInfo in class com.willowit.reporting.PentahoRenderer:
is a pretty generic error. It is the top level of the error log from the Pentaho reporting engine when almost anything goes wrong, and is what is returned to Odoo (OpenERP). As such, on its own, it is not helpful for working which of the numerous possible problems it can be.
Generally, the tomcat log file (catalina.out) can be far more helpful in working out what is wrong in the reporting set up.
There are a number of issues tagged with Failed to invoke method getParameterInfo on github.
Can I encourage people to look through the github issues and post there when looking for solutions.

SSIS The expression for variable 'Variable' failed evaluation. There was an error in the expression

So here we have an error I keep getting in my SSIS package but I can't see what is wrong with the statement. I have even tried another sql statement from a project that works and it still raises the error.
The system is VS 2005 running 64 bit debugger, on XP machine. The project has amongst other things a script task then a sql task, the script task outputs the month value to a variable (Dts.Variables("monthName").Value = month), which I then use to create dynamic table name in SQL statement. I haven't got to the excel sheet bit yet as I am trying to get the sql task stage working.
So i have a variable at package level called SQLTableCreate, and in that I have the properties set to:
Evaluate as Expression = true
Expression = "Create Table "+ #[user::monthName]+"(Column1 DATETIME,Column2 NVARCHAR(255),Column3 NVARCHAR(255),Column4 NVARCHAR(255),Column5 NVARCHAR(255),Column6 NVARCHAR(255),Column7 NVARCHAR(255),Column8 NVARCHAR(255),Column9 NVARCHAR(255),Column10 NVARCHAR(255))"
And when I build the package I get:
Nonfatal errors occurred while saving the package:
Error at Package: The variable "user::monthName" was not found in the Variables collection. The variable might not exist in the correct scope.
Error at Package: Attempt to parse the expression ""Create Table "+ #[user::MonthName]+"(Column1 DATETIME,Column2 NVARCHAR(255),Column3 NVARCHAR(255),Column4 NVARCHAR(255),Column5 NVARCHAR(255),Column6 NVARCHAR(255),Column7 NVARCHAR(255),Column8 NVARCHAR(255),Column9 NVARCHAR(255),Column10 NVARCHAR(255))"
" failed and returned error code 0xC00470A6. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.Error at Package: The expression for variable "SQLTableCreate" failed evaluation. There was an error in the expression.
There is also a default SQL statement for the variable SQLTableCreate, which uses the current excel connection manager table name. When I put my dynamic statement in the expression section of properties it fills the value and valuetype property of the SQLTableCreate variable with the message:
The expression for variable "SQLTableCreate" failed evaluation. There was an error in the expression.
It's exactly as the error says
The variable "user::monthName" was not found in the Variables collection
Things in SSIS are case sensitive and Variables are one of those things. Make your expression
"Create Table "+ #[User::monthName]+"(Column1 DATETIME,Column2 NVARCHAR(255),Column3 NVARCHAR(255),Column4 NVARCHAR(255),Column5 NVARCHAR(255),Column6 NVARCHAR(255),Column7 NVARCHAR(255),Column8 NVARCHAR(255),Column9 NVARCHAR(255),Column10 NVARCHAR(255))"
Also, I hope this table design is just a sample and not real. Lack of column names and strong data types is technical debt you don't need to incur at this stage.

SQL Exception: Unknown column in where clause

I am using Hibernate3 with spring application.
I introduced a column in my existing table with many to one relationship with the addition in the .hbm file as mentioned below:
<many-to-one name="qualityStatus" column="quality_status"
class="model.PurchaseStatus" lazy="false" fetch="join"/>
The corresponding object to this hbm has a property of type 'PurchaseStatus' and field name as 'qualityStatus'.
Now when i try fetching the data from the table representing the above object with the query:
List<Long> dnIds = session.createQuery("select dnItem.dnId from DeliveryNoteItem dnItem where dnItem.qualityStatus!=? and dnItem.qualityStatus!=? and dnItem.qualityStatus!=?")
.setInteger(0,1)
.setInteger(1,5)
.setInteger(2,7)
.list();
i get an error saying as 'java.sql.Exception: Unknown column 'deliveryno0_.quality_status' in 'where clause'
I get this error when deployed on test server but when i check the same thing on my local server i works fine as well when i just run this query directly on the database on the test server it returns me result. So it confirms that the database on the test server is alright. It is only when it executes through the application on the test server i am getting this error.
Can anybody let me know what can be the reason or how do i debug this out.
Thanks in advance. Looking forward for replies.
If you really have a quality_status column in your database, then you should make sure you have the most recent version of your application deployed on the test server, and make sure that the connection url of hibernate really points to the test database.
This is not a hibernate problem, not a programming one. It is environmental - check your configurations and redeploy.