Prior this problem I had another issue related to the same subject. The problem has been sorted thanks ta #ndm.
Link the previous problem: Cakephp 3. Windows and Linux OS returning different result when querying the database
I have an article page and I am retrieving the associated data with articles. Article comments.
I have the following line of code
$this->Articles->find()->contain('ArticleComments');
This line of code on both local Windows 10 machine and production Debian server retrieves all articles including their comment. find a link to a screenshot of the returned result using Cakephp debugging function pr($object)
Screenshot of the returned result: http://s29.postimg.org/f76brygw6/cakephp.jpg
Now the only problem I have, which occurs only on the production Debian server is that despite the aforementioned line of code is returning articles and article comments I cannot use this object. For an instance if I try the following code:
$this->Articles->find()->contain('ArticleComments')->toArray();
Or
$this->set('articles', $this->Articles->find()->contain('ArticleComments'));
I get this error:
Cannot convert value to integer
InvalidArgumentException
And the following error in tmp/error.log: http://s14.postimg.org/4e88qp6j4/cakephp_error.jpg
Again, this error occurs only on my Debian server and if I retrieve just articles by the following code it works fine.
$this->Articles->find()
What I have done to fix this issue:
Triple checked (twice) table and classes names. 100% sure the issue is not file naming one.
checked both machines PHP and Cakephp version. My Debian server runs PHP 5.6.15-1~dotdeb+zts+7.1 (cli) and My Windows 10 runs PHP 5.6.8 (cli). Cakephp versions are the same. Cakephp 3.1.4
The problem is, probably, the way you are loading the associations. You are required to tell Cake in what plugin your table class lives. Instead of doing this:
$this->hasMany('ArticleComments')
You need this:
$this->hasMany('Comments.ArticleComments')
Problem solved!
The issue was not coming from Linux nor CakePHP.
On my local machine which happens to be Windows OS I am running MySQL version 5.6.24 and on my live server, which runs Linux debian I have MySQL 5.5.46.
I had database columns "datetime" which is supported in 5.6 but was causing a problem in version 5.5.
I simply changed the column type to "timestamp" and the issue was resolved.
Both environments are running different OS's and an enormous amount of time was spent to ensure the issue is not Windows to Linux problem(i.e. filename case sensitivity). CakePHP misleading error messages has delay me to resolve the problem also.
I am glad after more than a month the problem is fixed :D
Related
I am using MYSQL and EF5(DB first) with connector/net 6.8.3.0. Everything works fine on my local machine but when I upload it to server it throws exception "Facet 'Precision' must not be specified for type 'datetime'".
Please let me know what is the reason.
Precision for datetime is added with MYSQL version 5.6 and I have generated the entities with latest MYSQL, so by default precision is added to the ssdl.
But on my server older version of MYSQL server was installed. This is the reason why it was throwing the exception.
Now with MYSQL server 5.6 we can have datetime(5) where 5 is the precision.
So we can have microsecond for datetime in MYSQL.
I too have been getting the "Facet 'Precision' must not be specified for type 'datetime'" error after publishing, but the cause of my problem differs from the OP's.
My Personal Solution
I have two independent servers: 'server1' with the EF5 web app, 'server2' with the database server1 references. Debugging the app on my local machine was no problem; but after I published to server1 the app kept crashing while trying to load. After much searching and testing I narrowed it down to either a configuration issue either with my application or MySQL. Finding this post (thank you kindly, user3275493, for answering your own question), I checked server2's MySQL config but alas it was already running MySQL Server 5.6. Just to be thorough (in reality this took me several days to realize), I decided to check MySQL Connecter and discovered that my local machine's was version 6.8.3 while server1's was version 5.6. After I updated Connector, I published my web app and it ran without flaw!
Simple Explanation
Not only will this error be caused by a MySQL version disagreement between Entity Framework and MySQL Server, but also between Entity Framework and MySQL Connector!
Problem
My problem started suddenly while I was working on my project.
Next day I tried to prepare some details on my site,and when I tried to open the server I had a problem with the database and my problem was like this...
After several days of search on web, I found a second database which I deleted it and after that the server works fine, but my project not...
I dont have access to back-end or front-end and displays this:
"Error displaying the error page: Application Instantiation Error".
Database
I know somethings going wrong with database i checked wamp mysql log which has a warning
:
[Warning] InnoDB: Cannot open table database1/culiz_session from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
I checked this link and I couldnt find what option works for me.
Conclusion
Any advice how can I work again on my project because I was almost done with the page and I cant start again from the scratch...
Details:
Windows 7
Joomla 3.1.5
WAMPSERVER (32 BITS & PHP 5.4) 2.4
Apache : 2.4.4
MySQL : 5.6.12
PHP : 5.4.16
PHPMyAdmin : 4.0.4
SqlBuddy : 1.3.3
XDebug : 2.2.3
Error displaying the error page should be a tip that there is no server available. Application Instantiation is the startup of the application failing - either because of the Apache server configuration, or because on or more of the the other server components isn't working or present ie. PHP or MySQL.
Suggest you make sure the WAMP server is running all the required services and is configured properly.
I have MySQL database hosted on server. I want to create WCF web service of that database. Actually I want to comsume WCF service in Windows Store App. I am following these articles.
Using an Entity Framework Entity as a Windows Forms Data Source
Making a Connection
But I am getting error Authentication with old password no longer supported, use 4.1 style passwords. Then searched Stack Overflow and got this solution, but it is also not working for me.
Please guide me to solve this issue.
PS : Please don't down vote this question, I have googled and searched in Stack Overflow but didn't get solution :(
UPDATE 1
I have applied command via phpMyAdmin in SQL query textbox. I also followed this Mysql password hashing method old vs new, but getting same error that "you have no SUPER privilege."
I have not managed to solve the problem as the others who have responded, although I tried out everything that has been proposed. In the end it turned out that the server on which stood my DB is not updated phpMyAdmin since version 3.5.5, and is currently being used everywhere version 4.1.14 and it is a problem. The solution is to update your host phpMyAdmin or your own mySQL back to an earlier version in order to continue working on remote DB. You may need this knowledge in order to solve some doubts that have arisen. :)
I'm using snort in win7.
We know that using snort in its sniffer mode we can log a lot packets
into a file, and now I want to log them to a mysql server. I enabled
the database output plugin in the snort.conf and customed a rule:
log ip any any <> any any (sid:2000000;)
as a test.
Everything is OK and I used a PC whose ip is 172.18.186.186 to ping another 172.18.186.189. What I hope to get is 8 records, among which there would be 4 records and their ip_srces are 172.18.186.186. However I just got 4 records and their ip_dsts are 172.18.186.186 while the ip_srces are 172.18.186.189.
OK,that's my problem. How can I get the 8 records I want to see? Is it possible?
Thanks in advance.
yes, you can check out snorby. and lot of implementation there are for connecting snort to a database, such as mysql or mongodb etc.
This article explaing you how u can log to mysql.
Please look at the output plugin unified2, because direct SQL output is deprecated in the snort tree 2.9.2 and will be removed at some point.
Barnyard2 is a binary capable of reading unified2 output and writing that data to a SQL, syslog, or other datasource.
FYI: Snorby is just a Ruby On Rails web app for a database schema for the ACID/BASE standard.
I have upgraded my server machine to use MySQL Connector 6.3.4 and in our website we also added Membership role provider.
When I run the website I am getting this error.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unable to initialize provider. Missing or incorrect schema.
My sql server is version 5.0.90 community-net.
Is there any setting which have to be changes on server side while upgrading connector
This is tag in my web.config file.
Since when I run the website on local machine it will run successfully, but on server I am not able to run it and getting above error.
There is no mistake in connection string
What are server side setting which we to do while upgrading the connector....
thanks
I myself running into the same problem. I m using Mysql connector 6.3.0.0
So far I came across following suggestions when seaching on net:
1) Add "MySql.Data.dll" & "MySql.Web.dll" into your application "bin" folder.
2) Add reference to above to dlls in your application .
3) Add autogenerateschema="true" in your web.config file for required sections.
4) Check your Mysql connector version - make sure that the one that is in your bin folder is mentioned in your web.config file.
5) Check your connection string - make sure it is correct and connected successfully.
6) Check mysql membership related table structure.
7) Check schema version in "my_aspnet_schemaversion" table (e.g since you have upgraded to newer version I insist you should check this).
8) If the problem is on remote machine (e.g Production Server) you may wan to check this : http://www.reggieburnett.com/referencing-connectornet-on-a-remote-machine
I m sure you may gone through this list but I would like you to check schema version in "my_aspnet_schemaversion" table (e.g compare "version" field value of your local and remote table) since your upgrading to newer version.
BTW: I have checked this list for my problem but it did not help. I hope it may be of some help to you.
Edit:
Hi,
We are able to fix this error by following:
1) Deleted the tables for memberships in the db and had the mysql membership provider regenerate them
2) than set the Aministration.config file to trust the Mysql Membership Provider (e.g related to IIS admin)
Regards,
Gaurav
I had this same problem after checking all the things in Gaurav's post. It ended up being that the user account I was using in my connection string did not have necessary permissions to alter the db schema (I had autogenerateschema set to true). Once I changed my connection string to a user with more privileges (I used the 'root' user) then it updated the schema, and I changed the connection string back to the original user.
Always make sure that the Datasource is set to the real ip address and not localhost and check the passwords and usernames too. I am working with these clients and their ip address keeps changing and every time they do that, I get the same error
I know this is an old thread but maybe this will help someone. I was having this issue and realized that I was editing the wrong machine.config
At first I was editing on under C:\Windows\Microsoft.NET\Framework64....
Once I found the one for my .NET version under C:\Windows\Microsoft.NET\Framework.... and edited the correct spots, it worked fine following the instructions on MySQL's site.