Jump to content

Warning: sprintf(): Too few arguments in /classes/db/DbPDO.php on line 102


Recommended Posts

Hello, I am working on a school project, and currently I am stress testing the application.

When the server is stressed (100 threads from jMeter), I get this warning:

 

Warning: sprintf(): Too few arguments in /db/DbPDO.php on line 102

 

Any idea what could be wrong? Is the server too low specs?

 

 

PS: the 102 line is:

$this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5);
Link to comment
Share on other sites

  • 1 month later...

Hello

 

you have to change the DB info :

 

app/config/parameters.php

 

and

 

app/cache/prod/appParameters.php

 

:)

I don't see these directories/files in my prestashop folder

OS: Debian, on a VPS

 

Link to comment
Share on other sites

  • 3 months later...

HELP!

Hi i'm an user of PRESTASHOP 1.7(Hosting: Siteground) and unfortunately I've the same problem, 

White screen in front office and BO with text "Fatal error" (that happened after clicking in BO>ADVANCED PARAMETER>PERFORMANCES the "delete cache" ICON (right top of the screen)).

So, following some topics I enabled the error visualization, and now in my frontoffice and my BO, I've the message "Warning: sprintf(): Too few arguments in /home/arpshop4/public_html/classes/db/DbPDO.php on line 102"
 
I checked my database info in app/config/parameters.php and app/cache/prod/appParameters.php
 
(CODE below)!!
 

<?php return array (
  'parameters' => 
  array (
    'database_host' => 'localhost',
    'database_port' => '',
    'database_name' => 'arpshop4_pres261',
    'database_user' => 'arpshop4_pres261',
    'database_password' => 'XXXXXXXXXXXXX',
    'database_prefix' => 'ps7o_',
    'database_engine' => 'InnoDB',
    'mailer_transport' => 'smtp',
    'mailer_host' => '127.0.0.1',
    'mailer_user' => NULL,
    'mailer_password' => NULL,
    'secret' => 'x2oqapvfqs8ylj6ktvfkg8qapro7ls7j28snuvu8ggrnofkjsutnzbsg',
    'ps_caching' => 'CacheMemcache',
    'ps_cache_enable' => false,
    'ps_creation_date' => '2017-05-23',
    'locale' => 'en-US',
    'cookie_key' => 'ktzsga7vuj0hc5w67ewqu6od9azbvvv9moxoyt9n2ln19eu9gbuyx7rc',
    'cookie_iv' => 'l88g0n3u',
    'new_cookie_key' => 'def0000063811a59ce7cc7389d01500e11f182229622cd5b1da4f81cff8d713bd8a4c20a403d0a08eda501b7ea03044957a87e2c69ab04e5aaf89b21814fe8b8a99d4629',
  ),
);

 
I also regenerate my DB password, and correct it in each files, but anything happened.

How can I solve that problem?  :( 

Thanks a million, for your precious help

Chiara

Edited by Chiara L. (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi, anyone can help me?

 

How can I ask for prestashop tech support?

 

Please,

 

Chiara

 

There is no personal support for free available from Prestashop team, but you can try this paid service: https://www.prestashop.com/en/support

 

I'm afraid that this is too abstract. It is a generic error. In general it is a zero php-error (runtime error).

The error is not really an error, but a warning could be also a missing module/extension on your server, restrictions set, or if project is an upgrade from older Prestashop version, so missing tables on database. Without having more informations about the configuration of your server, it is difficult to give valuable help.

Please allways inform also:

  • php-version ?
  • SQL package in use (mariaDB, MySQL)?
  • DB-pasword changed, before problem appeared, etc....
  • pdo extension for SQL installed ?
  • Cache in use ? (opcache, etc.)
  • fpm ? fast-cgi ?
  • Operating system ?
  • Modules in use ?
Link to comment
Share on other sites

Specially for @ Chiara L. and meumercadoorganico

 

Try to change in the file /app/config/parameters.php (and /app/cache/prod/appParameters.php) the first line database_host: from "localhost" to "127.0.0.1". I've seen that below on mailer you have already set the IP, but on server address you have localhost. Both are the same, but a mix of them will not work, unless you are on 2 different hosts on same server. Some provider use only the IP, others use localhost as name for server host configuration. A mix of boths will give an error on one of the addresses.

 

See same problem here: https://www.prestashop.com/forums/topic/429557-link-to-database-cannot-be-established-sqlstatehy000-2002-connection-timed-out/?do=findComment&comment=2614912

Error is another, but problem is the same.

Link to comment
Share on other sites

 

Hello Chiara.

Were you able to solve this problem?

Today I have the same problem and I do not know what to do.

Regards,

Dario

 

Hi Dario, unfortunately anyone was able to solve my problem. 

For some days, my hosting's developers tried to solve, but in the end they suggested me to ask someone for a private help by a specialized in PS.

I tried to import in local a precedent backup in local, but anything changed.

After ten days, with sadness in my heart i decided to restart my site from 0. Now i'm doing backup every step i do.

 

Here in the forum, these are the first answers I recive.

 

Prestashop support want only money, there is unfortunately, anyone just for knowing that the problem could be resolvable, before giving them money.

When that things happen, unfortunately you are alone. I didn't like that policy, but now unfortunately i chosed to put my business in their hands, and now i've to continue.

 

I hope that your error could be fixable,

 

Chiara,

 

P.s. Thanks to the other, for your answers!

Link to comment
Share on other sites

You tried to change the IP like I told before ? This could be the problem. localhost and mixing IP on same host, don't think this will work. Perhaps your mailserver is another, so another configuration is possible. Most of the cases this is not the case. In generalOr your host is configured with IP or it is configured by "localhost". Simply try. I don't know your server configuration.

If this does not solve your problem, so there must be a server problem, i.e. misconfiguration of the directives on your server. And yes, I know that provider like to say: it is a Pretashop problem.... Most mass providers simply are unable to configure their servers properly and take general directives or standard configuration don't taking care about that this not always will work.

 

BTW: if Prestashop 1.7. was working before on your server and suddenly is showing this error, so it must be something you have done (module or theme installed). Some free offers are not really good and yes they also make changes on database and override native scripts.

Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...