Unable to generate a prestashop error 500 invoice - symfony

I am coming to you because I have a problem with prestashop, when I try to generate an invoice after purchase, the site sends me back to an error 500 and I cannot recover my invoice, what to do?
Error returned to me by the site in production mode:
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when Ibis error occurred. We will fur it as soon as possible. Sorry for any inconvenience caused.
Error returned to me by the site in developement mode:
ClassNotFoundException
Attempted to load class "DpTools" from the global namespace. Did you forget a "use" statement?
in override/classes/order/OrderInvolce.php (line 52)
$products = parent::getProducts($products, $selected_products, $selected_pty);
if (is_array($products)))
{
foreach ($products as $index => $product)
{
if ((int)$product['id_product'] == DpTools::getSpecialProduct())//<< error Line
unset($products[$index])
}
}
return $products;
}

This error means that your Prestashop OrderInvoice.php file had been overriden by a module and it's not the original one.
Try inspecting
override/classes/order/OrderInvoice.php
in your FTP - You should be able to find the module name that is causing the override in a comment.
Then try to disable or uninstall that module and see if the issue is still there.
Otherwise you can try to rename that override/classes/order/OrderInvoice.php and empty the cache so the original one will be used , this will probably interfere with that module functionalities , though.

Related

Symfony4: Gos Websocket Error: MySQL server has gone away

I have enabled the PDO Periodic Pings for GOS:WebSocketBundle, I'm still getting this error from time to time:
09:41:28 ERROR [websocket] Connection error occurred Warning: Error
while sending QUERY packet. PID=30536 in /home/dev.symfony/libs/composer_vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
10:00:23 ERROR [websocket] Connection error occurred
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in
/home/dev.symfony/libs/composer_vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
line 107 ["connection_id" => 3365,"session_id" =>
"11667050395acf121709d30728596936"] []
Another point is that if nobody use dev server, in logs no errors, but if I login to this immediatelly appear this error.
There is issue opened also on github https://github.com/GeniusesOfSymfony/WebSocketBundle/issues/299
but no answers, so I asked also here. Thank you.
Solved. Problem was that I defined periodic timer inside Topic inside "onSubscribe" funciton like:
public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{
...
$topicTimer = $connection->PeriodicTimer;
//Add periodic timer every 3 seconds update
$topicTimer->addPeriodicTimer('notifications', 3, function() use ($topic, $connection) {
$user = $this->clientManipulator->getClient($connection);
if($user) {
$counters = $this->globalVariables->getCounters($user);
$connection->event($topic->getId(),['msg' => $counters]);
}
});
...
}
But now I switched to "standalone" periodic like it described here https://github.com/GeniusesOfSymfony/WebSocketBundle/blob/master/Periodic/PdoPeriodicPing.php
and attached this to websocket. Now there is no timeout with database.
It's worth noting that when you follow the Symfony documentation with creating PdoSessionHandler http://symfony.com/doc/current/doctrine/pdo_session_storage.html where you are passing the dsn instead of pdo service it won't work, because the session handler will create other connection. To solve this create a pdo service and pass it to the PdoSessionHandler like it is described in the https://github.com/GeniusesOfSymfony/WebSocketBundle/blob/master/Resources/docs/SessionSetup.md

After upgrade attempting to get artifact results in "Could not process download request: Binary provider has no content for"

I recently upgraded our artifactory repository from 2.6.5 to the current version 5.4.6.
However, something seems to have gone wrong in the process. There are some artifacts that throw a HTTP 500 error when attempting to access them. Here is an example using wget:
wget http://xyz.server.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.0.12/build-info-extractor-gradle-2.0.12.pom
--2017-09-12 12:17:13--
http://xyz.server.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.0.12/build-info-extractor-gradle-2.0.12.pom
Resolving xyz.server.com (xyz.server.com)... 10.125.1.28
Connecting to xyz.server.com (xyz.server.com)|10.125.1.28|:8081... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2017-09-12 12:17:13 ERROR 500: Internal Server Error.
I verified this by going to the artifactory site, browsing to the object in question, and trying to download it. The result was the following:
{
"errors" : [ {
"status" : 500,
"message" : "Could not process download request: Binary provider has no content for 'e52a9a9a58d6829b7b13dd841af4b027c88bb028'"
} ]
}
The problem seems to be in the final step of the upgrade process, upgrading from 3.9.5 to 5.4.6. The wget command above works on 3.9.5, but not on the 5.4.6 instance.
I found a reference to a "Zap Cache" function in older documentation and thought it might fix things, but I don't seem to be able to find that function in the current site.
Is anyone able to point me to: a way to fix this issue, or what I need to do/look for in the upgrade process in order to prevent it from occurring?
As a further data point, we're using an Oracle database for the full file store, if that matters in any way (using the tag: <chain template="full-db"> in binarystore.xml)
Thanks in advance....

Parse error when on production

I have developed a Symfony2 project (v2.2.2) and it was working all fine locally.
When I deploy it on my server I meet 2 issues:
the folder /bin does not transfer through Filezilla (impossible to start transfer)
i encounter a parse error when trying to access web/app.php/ in debug mode (see below)
First I do not understand why it would work in local but not on production.
I also guessed these errors where linked but I do not know what is /bin used for (contains only 2 files doctrine and doctrine.php) and if I remove it locally it keeps working ...
Parse error is the following :
"FatalErrorException: Parse: syntax error, unexpected '[' in /home/colocall/twinkler/src/Tk/ExpenseBundle/Services/Expenses.php line 21"
Expenses.php line 15->25:
public function getAllExpenses($member, $group)
{
$all_expenses_col = $group->getExpenses();
$all_expenses = array();
foreach($all_expenses_col as $expense){
$all_expenses[] = [$expense, $this->forYou($member, $expense)];
}
return $all_expenses;
}
Maybe linked to : The parse error also happen when i try to update my database through ssh connection.
If someone would know the reason why I can't make it working it would save my day that i have already lost ...
Thank you in advance,
Jules
Your error is produced by using the short array syntax [] in your code.
It is not available in PHP 5.3.10 aka on your production server. The short syntax was introduced in PHP 5.4 which explains why your code is working in your dev-environment.
change ...
$all_expenses[] = [$expense, $this->forYou($member, $expense)];
...to
$all_expenses[] = array($expense, $this->forYou($member, $expense));
... or update your server's php version and it will work :)

Wordpress error after upgrade "cannot redeclare" + "eval()'d"

Getting this error after a forced wordpress upload (I was working in the database when at one point of time I got an alert - while on the backend, with only one option to upgrade to the newer available version):
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code on line 1
The above is when I try mydomain.com
When I try mydomain.com/wp-admin/, I am redirected to wp-login.php and getting the following error:
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code on line 1
Pulling my hair out trying different things since 5 hours now. Any help will be appreciated.
EDIT: After testing, I found that the function.php file is correctly calling function twentyeleven_header_style() and the problem is coming just after calling this function. So it's the next function call that is causing the problem. If I could know what is the next function !!!
Wordpress doesn't use functions with those names. Deactivate your plugins or rename the plugins folder.
If that doesn't work then it's probably coming from your theme. Rename your theme folder so wordpress will revert to the default (assuming the default theme exists).
It sounds like you purchased a theme or plugin with obfuscated code and it's using eval() to run it and probably making a call home.
After much research, I found that the site in question was hacked. More than 100 files were corrupted with codes. I cleaned them all and now things are functioning.
For others facing the same problem, download the whole files to your computer and look for eval codes (can be easily recognized).

TimThumb images not showing - On inspection error is shown

Wondering if you can help me. I have installed a theme that comes with TimThumb.
However when I set the featured image, and view the blog, the images doesn't load, when I right click and click view image in a new tab I get the following error message:
A TimThumb error has occured
The following error(s) occured:
Could note create the index.html file.
Could note create cache clean timestamp file.
Query String : src=http://demo.webempire.net.au/shi/wordpress/wp-content/uploads/2012/01/menora2_kitchen011.jpg&w=144&h=94
TimThumb version : 2.8.3
Any suggestions/help would be appreciated.
I ran into this issue.
define ('FILE_CACHE_DIRECTORY', '');
was set in timthumb-config.php . This gave me these errors:
touch() [<a href='function.touch'>function.touch</a>]: Utime failed: Permission denied in timthumb/timthumb.php on line 469
in timthumb/error-log.
Commenting out the line in timthumb-config.php set timthumb.php to use ./cache as the cache folder instead of the system tmp folder, and fixed avoided the permission issues.
The problem was that another user already had a timthumb_cacheLastCleanTime.touch in /tmp
Wiping didn't work but changing the permissions to 777 did. Via filezilla.

Resources