Web based family history software

Question PDO Duplicate Error On Attempting Upgrade

  • slateronline
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #1 by slateronline
PDO Duplicate Error On Attempting Upgrade was created by slateronline
Hi

On attempting a regular upgrade tonight I was forced to roll back due to getting this (cleared browser cache):

"#0 /app/Statement.php:86 PDOException("SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1494107185-1494107185--unknown' for key 'wt_site_access_rule_ix1'") #1 /includes/session.php:357 execute([array]) #2 /admin.php:28 require('/home/#####/public_html/fam…')"

Any help appreciated. Tnx.

Neil

Neil
latest v2.1.16 | php v8.2 | mysql v7.4.28
Site: familytree.slateronline.com

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #2 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
Maybe this: bugs.launchpad.net/webtrees/+bug/1423127

PHP appears to be giving inconsistent views of the $_SERVER information. It seems to give different versions of the same information depending on whether you query it via the superglobal or via filter_input(). Also, it might be putting it in the $_ENV variable instead.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • slateronline
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 1 month ago #3 by slateronline
Replied by slateronline on topic PDO Duplicate Error On Attempting Upgrade
Might be worth you knowing that the host server is running cPanel, and it allows me to run different PHP versions on a per-folder basis. I'm choosing to run 5.5 on this beta/git install of webtrees, but the server may well report the default host version when queried via different methods?

Neil
latest v2.1.16 | php v8.2 | mysql v7.4.28
Site: familytree.slateronline.com

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #4 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
Perhaps you could investigate whether
Code:
filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')

gives you the same results as
Code:
$_SERVER['HTTP_USER_AGENT']

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • resist
  • Visitor
  • Visitor
9 years 1 month ago #5 by resist
Replied by resist on topic PDO Duplicate Error On Attempting Upgrade
I have the same problem here. Do you have any suggestion, what can I do to resolve this problem?

Code:
<?php var_dump(filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')); echo '<br>- x -<br>'; echo $_SERVER['HTTP_USER_AGENT'];

Results:

Code:
NULL - x - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

Thank you!

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #6 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
This seems to be a bug in PHP.

bugs.php.net/bug.php?id=49184

What exact build/version of PHP are you using?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • resist
  • Visitor
  • Visitor
9 years 1 month ago #7 by resist

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #8 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
OK - thanks.

I guess we will need to modify webtrees to avoid this PHP function...

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • resist
  • Visitor
  • Visitor
9 years 1 month ago #9 by resist
Replied by resist on topic PDO Duplicate Error On Attempting Upgrade
Ok,
thanks for your answers!

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #10 by meliza
Replied by meliza on topic PDO Duplicate Error On Attempting Upgrade
I had the same issue. I sent today Greg my locally changed code that solves the issues at least for my site.

includes/session.php, includes/php_53_compatibility.php and admin_site_access.php

webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #11 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade

resist wrote: I have the same problem here. Do you have any suggestion, what can I do to resolve this problem?

Code:
<?php var_dump(filter_input(INPUT_SERVER, 'HTTP_USER_AGENT')); echo '<br>- x -<br>'; echo $_SERVER['HTTP_USER_AGENT'];

Results:

Code:
NULL - x - Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

Thank you!


What happens if you do this in the reverse order. e.g. $_SERVER first and filter_input() second.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • resist
  • Visitor
  • Visitor
9 years 1 month ago #12 by resist
Replied by resist on topic PDO Duplicate Error On Attempting Upgrade
I'm not sure I understand your question, but for
Code:
echo $_SERVER['HTTP_USER_AGENT']; echo '<br>- x -<br>'; var_dump(filter_input(INPUT_SERVER, 'HTTP_USER_AGENT'));

I get
Code:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0 - x - NULL

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #13 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
Thanks. That is exactly what I wanted.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #14 by meliza
Replied by meliza on topic PDO Duplicate Error On Attempting Upgrade
On my server
echo $_SERVER;
and
echo filter_input(INPUT_ENV, 'HTTP_USER_AGENT');
show the same result

and
echo Filter::server('HTTP_USER_AGENT');
and
echo filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
show NULL

Meliza

webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #15 by meliza
Replied by meliza on topic PDO Duplicate Error On Attempting Upgrade
Again a mistake. Should have been
echo $_SERVER;

webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #16 by meliza
Replied by meliza on topic PDO Duplicate Error On Attempting Upgrade
echo $_SERVER...
something removes the rest

webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago #17 by fisharebest
Replied by fisharebest on topic PDO Duplicate Error On Attempting Upgrade
If you want to add code examples, you should wrap them in

[ c o d e ]
[ / c o d e ]

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago #18 by meliza
Replied by meliza on topic PDO Duplicate Error On Attempting Upgrade
Thanks. I'll try to remember next time.

webtrees 1.8.0-dev at amitys.com/webtrees - php 5.6.29 - mysql 5.0.11-dev

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}