500 - No valid database connection:MySQL server has gone away - joomla

I have a website under the joomla in one of the hosting servers. It was working fine until yesterday. But starting from yesterday when I open the web site it gives me following error:
500 - No valid database connection:MySQL server has gone away SQL=SELECT a.*, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug FROM jos_content AS a INNER JOIN jos_categories AS cc ON cc.id = a.catid INNER JOIN jos_sections AS s ON s.id = a.sectionid WHERE a.state = 1 AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2012-03-04 17:59:41' ) AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2012-03-04 17:59:41' ) AND s.id > 0 AND a.access <= 0 AND cc.access <= 0 AND s.access <= 0 AND s.published = 1 AND cc.published = 1 ORDER BY a.created DESC LIMIT 0, 5
Or sometimes it just says :
Internal Server Error.
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What could be wrong with it? Or it is the host center who has a problem?

Change the database type from mysql to mysqli.

Related

Error thrown when attempting to install Magento on cPanel

As stated in title, when trying to install Magento through Installatron on cPanel it throws an error everytime saying:-
"A database query has failed. Is the entered database information correct? Does the account have available disk space?
Technical information:
method = query
arguments = array ( 0 => 'SELECT user_id FROM mg_admin_user WHERE is_active=\'1\' ORDER BY user_id ASC LIMIT 1', 1 => NULL, 2 => 'user_id',)"

Laravel Vue js project changes not working

I added two columns at the database table, also added those two columns at the model fillable attribute.
When I run a route to see the result. It's saying unknown column. Actually it exists at the database Table.
I am working on Laravel with Vue project.
Now am facing deployment issues.
First of all, when I uploaded the entire project to Cpanel from my local machine. Everything working properly.
But, when later I changed any query or other things it's not reflecting on the browser.
What I tried to solve this problem?
Step 1: Removed cache, views, routes
Step 2: npm run dev at the local machine and uploaded public/js/app.js from local machine project to Cpanel project public/js directory.
After upload app.js to the Cpanel public/js folder, I am running again the cache remove command. But there is no change reflection.
How I remove cache through the route below :
use Illuminate\Support\Facades\Artisan;
Route::get("reboot",function (){
Artisan::call('config:cache');
Artisan::call('route:clear');
Artisan::call('view:clear');
Artisan::call('cache:clear');
dd("Ready to Re-start");
});
Api response error :
"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'start_timestamp' in 'where clause' (SQL: select count(*) as aggregate from `vehicle_prices` where `rental_duration_id` = 5 and `rate` between 0 and 55 and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and exists (select * from `users` where `vehicles`.`partner_id` = `users`.`id` and `is_vehicle_release` = 1 and `status` = 1) and `service_id` = 1 and `status` = 1 and `passenger` >= 1 and `bag` >= 1 and exists (select * from `vehicle_cities` where `vehicles`.`id` = `vehicle_cities`.`vehicle_id` and (`country` = BD and `locality` = Dhaka or `additional_locality_1` = Dhaka or `additional_locality_2` = Dhaka or `additional_locality_3` = Dhaka or `additional_locality_4` = Dhaka) and `vehicle_cities`.`deleted_at` is null) and not exists (select * from `reservations` where `vehicles`.`id` = `reservations`.`vehicle_id` and ((`start_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00 or `end_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00) or (`start_timestamp` <= 2020-09-11 08:43:00 and `end_timestamp` >= 2020-09-11 04:00:00))) and `vehicles`.`deleted_at` is null) and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and `vehicles`.`deleted_at` is null))",
Database structure :
How to deal with this problem?
The npm run watch command will continue running in your terminal and watch all relevant files for changes. Webpack will then automatically recompile your assets when it detects a change:
npm run watch
You need to watch your changes with the command npm run watch if you are not able to see your changes after compiling then it means your project front end is caching, you can specify the version of your compiled file from where you include it in your application. you can do it like this.
or do this so that you don't keep changing version very time you update

How to access a single field of the logstash metadata event?

I am using logastash 7.6 with the output-jdbc plugin, but I get an error and I understand that it is because in the event it sends me all the fields to be indexed that are part of #metadata.
Probe just putting the event name without # and it works for me.
How can I get a single field within a #metada set?
ERROR:
ERROR logstash.outputs.jdbc - JDBC - Exception. Not retrying {:exception=>#, :statement=>"UPDATE table SET estate = 'P' WHERE codigo = ? ", :event=>"{\"properties\":{\"rangoAltura1\":null,\"rangoAltura2\":null,\"codigo\":\"DB_001\",\"rangoAltura3\":null,\"descrip\":\"CARLOS PEREZ\",\"codigo\":\"106\",\"rangoAltura5\":null,\"active\":true},\"id\":\"DB_001_555\"}"}
My .conf:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","%{[#metadata][miEntidad]}"]
{[#metadata][miEntidad]} -----> map['entidad_temp'] = event.get('entidad')
According to the output jdbc plugin README you have it set correctly/
Maybe try the following as a work-around:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","[#metadata][miEntidad]"]

Strange query behavior oracle 11g

I have a query as:
SELECT ps_node_id,name
FROM cz_ps_nodes WHERE cz_ps_nodes.ps_node_type=261
START WITH NAME = 'Bundle Rule Repository',cz_ps_nodes.devl_project_id = P_devl_project_id AND cz_ps_nodes.deleted_flag = 0
CONNECT BY PRIOR ps_node_id = parent_id.
This query works.
But if I just remove the name from the select part like:
SELECT ps_node_id
FROM cz_ps_nodes WHERE cz_ps_nodes.ps_node_type = 261
START WITH NAME = 'Bundle Rule Repository',cz_ps_nodes.devl_project_id = P_devl_project_id AND cz_ps_nodes.deleted_flag = 0
CONNECT BY PRIOR ps_node_id = parent_id.
The query just hangs but was working on oracle 10 g and the problem started when we upgraded to oracle 11g.
Could anyone explain why?
Got the issue solved by using : alter session set optimizer_features_enable='10.2.0.4' –

Getting syntax error at the end of the input while executing a query using postgres java driver

Have the following query that is giving error while executing through java driver, no errors while executing on DBVisualizer
SELECT pr.id,
pr.name,
CDPC.category_id,
CDPC.category_depth,
CDPC.product_count,
pr.primary_category_id
FROM ics_products_to_include_tmp inc
INNER JOIN catalog.products pr ON inc.product_id = pr.id
INNER JOIN catalog.products_in_categories pic ON pic.product_id = pr.id AND pic.active = true
INNER JOIN catalog.categories CC ON CC.id = pic.category_id AND CC.active = true
INNER JOIN category_depth_product_count_tmp CDPC
ON CDPC.category_id = CC.id
AND NOT EXISTS (SELECT *
FROM ics_products_cds_ids_tmp cds
WHERE cds.product_id = pr.id)
WHERE pr.site_id = '150'
ORDER BY pr.id
Here is the error
Exception in thread "main" org.postgresql.util.PSQLException: ERROR: syntax error at end of input
Position: 495
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1836)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:381)
at com.cnetchannel.ics.loader.IntermediateDatafeedGenerator.main(RRToIntermediateLoader.java:798)
Disconnected from the target VM, address: '127.0.0.1:51077', transport: 'socket'
Try using the Dollar-quoted notation.
Instead of having pr.site_id = '150' try it with something like
pr.site_id = $$150$$
Most probably your JDBC driver has problem distinguishing the two different quotes ' (&#39) and ` (&#96)

Resources