Unexpected EOF and Invalid Connection Beego ORM - mysql

This happens when I already connected website and didn't do anything while and try to reconnect again I gets this error at first attempt.
unexpected EOF, invalid connection
I found the error log:
[mysql] 2019/09/11 09:21:56 packets.go:36: unexpected EOF
[ORM]2019/09/11 09:21:56 -[Queries/default] - [FAIL / db.Query / 0.0ms] - [SELECT T0.`i_d`, T0.`username`, T0.`password`, T0.`firstname`, T0.`lastname`, T0.`email`, T0.`stack_i_d`, T0.`stack_password`, T0.`default_tenant_i_d`, T0.`role`, T0.`created`, T0.`updated`, T0.`is_activated` FROM `user` T0 WHERE T0.`email` = ? ] - `EMAIL#YAHOO.COM` - invalid connection
And second try I successfully connect to website by login
[ORM]2019/09/11 09:23:46 -[Queries/default] - [ OK / db.Query / 6.9ms] - [SELECT T0.`i_d`, T0.`username`, T0.`password`, T0.`firstname`, T0.`lastname`, T0.`email`, T0.`stack_i_d`, T0.`stack_password`, T0.`default_tenant_i_d`, T0.`role`, T0.`created`, T0.`updated`, T0.`is_activated` FROM `user` T0 WHERE T0.`email` = ? ] - `EMAIL#YAHOO.COM`

Related

Fatal mySQL error while trying to access DVWA

I am trying to setup DVWA and I did all the steps according to this video (https://www.youtube.com/watch?v=cak2lQvBRAo) till renaming the config file to config.nic.php and changing the password field to blank.
Something like this-
$_DVWA[ 'db_server' ] = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'dvwa';
$_DVWA[ 'db_password' ] = '';
$_DVWA[ 'db_port'] = '3306';
I get the error on this page (http://127.0.0.1/login.php)-
Fatal error: Uncaught mysqli_sql_exception: Unknown database 'dvwa' in C:\xampp\htdocs\dvwa\includes\dvwaPage.inc.php:499
Stack trace:
#0 C:\xampp\htdocs\dvwa\includes\dvwaPage.inc.php(499): mysqli_query(Object(mysqli), 'USE dvwa')
#1 C:\xampp\htdocs\login.php(8): dvwaDatabaseConnect()
#2 {main}
thrown in C:\xampp\htdocs\dvwa\includes\dvwaPage.inc.php on line 499
Can't even access the DVWA setup. I am using XAMPP and the Apache2 (ports 80, 443) and mySQL (port 3306) are running fine. Please help!
Got the answer for you.
Try localhost/dvwa/setup.php on browser
Then click on create or reset database and it should get to login page
Remember user name and password must be same as what you configured in config.php
Good luck

Not able to create mysql user with AWSAuthenticationPlugin with terraform

I am trying to create a MySQL user to use with IAM, and I am using terraform to do this.
This is what I am trying to accomplish :
CREATE USER 'lambda' IDENTIFIED WITH AWSAuthenticationPlugin as 'RDS';
with
provider "mysql" {
alias = "kadamb-test"
endpoint = "${aws_db_instance.kadamb-test.endpoint}"
username = "${aws_db_instance.kadamb-test.username}"
password = "${aws_db_instance.kadamb-test.password}"
}
resource "mysql_user" "kadamb-test-iam-user" {
provider = "mysql.kadamb-test"
user = "kadamb_test_user"
host = "%"
auth_plugin = "AWSAuthenticationPlugin"
tls_option = ""
}
This is the output when I am running terraform-apply:
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ mysql_user.kadamb-test-iam-user
id: <computed>
auth_plugin: "AWSAuthenticationPlugin"
host: "%"
user: "kadamb_test_user"
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
mysql_user.kadamb-test-iam-user: Creating...
auth_plugin: "" => "AWSAuthenticationPlugin"
host: "" => "%"
user: "" => "kadamb_test_user"
Error: Error applying plan:
1 error(s) occurred:
* mysql_user.kadamb-test-iam-user: 1 error(s) occurred:
* mysql_user.kadamb-test-iam-user: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
I am reading the documentation and trying to debug what is going wrong, but couldn't find anything.
Can anyone help me with this?
Just changing tls_option = "" to tls_option = "NONE", solved my problem.
I am not sure, how and what difference did it make, but I was able to create the user with this.

graphhopper GHRequest not fetching

I have a problem with this code:
GraphHopperAPI gh = new GraphHopperWeb();
gh.load("http://localhost:8989/api/route");
GHResponse ph = gh.route(new GHRequest(45.104546,7.69043,45.104546,7.69043));
It gives me this error:
2014-03-29 09:33:00,036 [main] INFO graphhopper.http.GraphHopperWeb - Full request took:0.037406, API took:0.0
Exception in thread "main" java.lang.RuntimeException: Problem while fetching path 45.104546, 7.69043->45.104546, 7.69043
at com.graphhopper.http.GraphHopperWeb.route(GraphHopperWeb.java:119)
at provaMain.main(provaMain.java:23)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at character 0
at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at org.json.JSONObject.<init>(JSONObject.java:179)
at org.json.JSONObject.<init>(JSONObject.java:402)
at com.graphhopper.http.GraphHopperWeb.route(GraphHopperWeb.java:95)
... 1 more
The documentation currently undergoes a change (moving it from wiki to source). Where did you find that snippet? Please try gh.load("http://localhost:8989/"); for the latest branch and gh.load("http://localhost:8989/api"); before.

Trouble connecting to MySQL Zend Framework

I'm trying to set up an application using the Zend Framework but the problem i'm getting is as soon as i add the following line in the application.ini the default home page that is created by the zend tool throws a fatal error
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with
message 'Configuration array must have a key for 'password' for login
credentials' in C:\xampp\php\PEAR\Zend\Db\Adapter\Abstract.php:295
Stack trace: #0 C:\xampp\php\PEAR\Zend\Db\Adapter\Abstract.php(183):
Zend_Db_Adapter_Abstract->_checkRequiredOptions(Array) #1
C:\xampp\php\PEAR\Zend\Db.php(270):
Zend_Db_Adapter_Abstract->__construct(Array) #2
C:\xampp\php\PEAR\Zend\Application\Resource\Db.php(142):
Zend_Db::factory('PDO_MYSQL', Array) #3
C:\xampp\php\PEAR\Zend\Application\Resource\Db.php(154):
Zend_Application_Resource_Db->getDbAdapter() #4
C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(683):
Zend_Application_Resource_Db->init() #5
C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(626):
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('db')
6 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(586):
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #7
C:\xampp\php\PEAR\Zend\Ap in
C:\xampp\php\PEAR\Zend\Db\Adapter\Abstract.php on line 295
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.dbname = codenamesnm
i'm using xampp with windows 7 Any idea what is wrong
Do not omit these lines:
resources.db.params.username = rob
resources.db.params.password = 123456
set them to "root" or "" if necessary, but let them into your application.ini.

what this error means? [Erlang, mochiweb, MySQL]

I made a comet chat server with Erlang and Mochiweb. And I run the "./start-dev.sh" to start the server. But after about 1 month I got the following error:
=ERROR REPORT==== 26-Sep-2009::09:21:06 ===
{mochiweb_socket_server,235,
{child_error,
{badmatch,
{error,
[70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
"closed"]}}}}
mysql: fetch "SELECT appKey FROM applications WHERE appID = 1" (id p1)
=CRASH REPORT==== 26-Sep-2009::09:21:10 ===
crasher:
initial call: mochiweb_socket_server:acceptor_loop/1
pid: <0.4271.23>
registered_name: []
exception error: no match of right hand side value
{error,[70,97,105,108,101,100,32,115,101,110,100,105,110,
103,32,100,97,116,97,32,111,110,32,115,111,99,
107,101,116,32,58,32,"closed"]}
in function moonwalker_web:loop/2
in call from mochiweb_http:headers/5
ancestors: [moonwalker_web,moonwalker_sup,<0.52.0>]
messages: []
links: [<0.54.0>,#Port<0.792854>]
dictionary: [{mochiweb_request_body,
<<"appID=1&appKey=keyy&userID=8048943&nickName=bill&buddies=N%3B&timestamp=1253928070154">>},
{mochiweb_request_recv,true},
{mochiweb_request_post,
[{"appID","1"},
{"appKey","key"},
{"userID","8048943"},
{"nickName",[143,229,167,144]},
{"buddies","N;"},
{"timestamp","1253928070154"}]},
{mochiweb_request_path,"/online"}]
trap_exit: false
status: running
heap_size: 2584
stack_size: 24
reductions: 1368
neighbours:
=ERROR REPORT==== 26-Sep-2009::09:21:10 ===
{mochiweb_socket_server,235,
{child_error,
{badmatch,
{error,
[70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
"closed"]}}}}
And if turn the following numbers into characters
[70,97,105,108,101,100,32,115,101,110,100,105,110,103,32,100,
97,116,97,32,111,110,32,115,111,99,107,101,116,32,58,32,
"closed"]}}}}
they are
Failed sending data on socket :"closed"
Does that mean I have problems with MySQL connection or socket?
I don't know if this error has something to do with my "./start-dev.sh" or I just had some wrong settings?
And what else information do I have to provide for diagnosing?
Thanks and looking forward to your reply?
It looks like somewhere in the loop/2 function you don't handle an {error,Error} return from a function call. This causes the error which crashes the process. Without the code it is difficult to say what caused the error return.