Skip to content

sql2graphite - TypeError: not enough arguments for format string

Just ran into following issue.

Traceback (most recent call last): File "/usr/local/bin/sql-to-graphite", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/sql_to_graphite/__init__.py", line 55, in main get_executor(dsn), File "/usr/local/lib/python2.7/dist-packages/sql_to_graphite/__init__.py", line 25, in run data = map(executor, queries) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 942, in execute return self._execute_text(object, multiparams, params) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1104, in _execute_text statement, parameters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception util.reraise(*exc_info) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context context) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 507, in do_execute cursor.execute(statement, parameters) File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 187, in execute query = query % tuple([db.literal(item) for item in args]) TypeError: not enough arguments for format string

Result is, that I've created a sql statement with a >>%<< inside. I need to escape it (transform it to >>%%<<) and all is fine.

Translate to de es fr it pt ja
Categories: coding
Vote for articles fresher than 7 days!
Derzeitige Beurteilung: 1 of 5, 2 Stimme(n) 1597 hits

Die KW 4/2019 im Link-Rückblick

Translate to de es fr it pt ja

Running Contao 3.x version and upgrading from PHP 5.x to PHP 7 results in a 500 Status?

I had the joy to debug a not working contao system line by line.

Why line by line? Because there was no entry in any logs, even with "log all motherfucker"-php.ini values on.

After parsing the lines, I ended up into this error message.

Fatal error: Cannot use 'String' as class name as it is reserved in ... system/modules/core/library/Contao/String.php on line 28

Well, nice to know the error but where was this triggered? So another round with joy and I ended up with an extension, of course installed "by hand" which means not possible to update by the contao updater and this lovely line.

$this->import('String');

After I've changed that line to the following line, all the gizmos where working again.

$this->import('StringUtils');

So, what should you do when you where faced with a 500 Apache Status Code after a contao installation moved from an PHP 5.x runtime environment to a PHP 7.x runtime environment?

cd <project root> grep -ir "import('String');" *

Replace >>import('String');<< with >>import('StringUtil');<< and that is it.

But all would be better if you are not installing extensions by hand.

Translate to de es fr it pt ja
Categories: coding
Defined tags for this entry: , ,
Vote for articles fresher than 7 days!
Derzeitige Beurteilung: 1 of 5, 3 Stimme(n) 238 hits

Die KW 3/2019 im Link-Rückblick

Translate to de es fr it pt ja

How to upgrade nextcloud from gui to next major version

So, nextcloud version 15.0.x is out already and whenever you are logging into your next cloud with your administrator account, you still get this "you are on the latest version" message.

Further more, you just got a update to version 14.0.x while waiting for version 15.0.x.

To fix this, all you have to do is to switch from the channel "stable" to "beta". After a page reload, you should see a version 15.0.x available. Do the upgrade and do not forget to switch back to the stable channel.

Translate to de es fr it pt ja

Die KW 2/2019 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 1/2019 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 52/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 51/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 50/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 49/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 48/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 47/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 46/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 45/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 44/2018 im Link-Rückblick

Translate to de es fr it pt ja

>>Uncaught Bunny\Exception\ClientException: Broken pipe or closed connection.<< and how to solve it

We were running into this issue when our consumers or producers had nothing to do in a minute or less.

After searching the web, we found this issue ticket within the conversation.

Long story short, we could solve our problem by overwriting the default heartbeat with 30 seconds.

//this is an example but full blown configuration we are using
$client = new Client(
    [
        'heartbeat' => 30,
        'host'      => '127.0.0.1',
        'password'  => 'guest',
        'user'      => 'guest',
        'vhost'     => '/'
    ]
);

If you want to know more, you can read about rabbitmq networking here and about rabbitmq detecting dead tcp connections with heartbeat and tcp keepalives here

Translate to de es fr it pt ja
Categories: coding
Defined tags for this entry:
Vote for articles fresher than 7 days!
[0] 864 hits

Die KW 43/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 42/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 41/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 40/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 39/2018 im Link-Rückblick

Translate to de es fr it pt ja

Die KW 38/2018 im Link-Rückblick

Translate to de es fr it pt ja