php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80258 Windows Deduplication Enabled, seeing randon permission errors
Submitted: 2020-10-19 13:14 UTC Modified: 2020-10-20 13:00 UTC
From: joshdmo at gmail dot com Assigned: cmb (profile)
Status: Closed Package: SQLite related
PHP Version: 7.4.11 OS: Windows 2016 Standard
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joshdmo at gmail dot com
New email:
PHP Version: OS:

 

 [2020-10-19 13:14 UTC] joshdmo at gmail dot com
Description:
------------
We have Windows deduplication enabled on our 2016 servers for several years but I think we found something out of whack with the latest PHP version. I originally upgraded from 7.4.7 to 7.4.11, when I had problems I then attempted to downgrade to 7.4.10 and the problem remained, but with 7.4.9 I have no issues.  While our primary web product had some 'Unable to find resource' type errors loading, the simplest example I can provide is our health check script that we have setup for testing Database connectivity.  On versions 7.4.11 and 7.4.10 the SQLite check fails with the error I provided under Actual Result. 


I am using the Windows PHP NTS build as provided on your site. I tested this on 2 servers, and each server would start to work if I either downgraded to php 7.4.9, or disabled Deduplication and ran the powershell script to unoptimize all the files. 

Test script:
---------------
<?php
	include 'includes/autoload.php';

	//SQLite
	$db_path = 'abb20htm.db3';
	$db = new PDO('sqlite:'.$db_path);//connection
	$bookdb3_class = new BookDb3($db);
	$sgt = '3';//res
	$row = $bookdb3_class->getFirstPageLabel($sgt)->getResults();
	//$bookdb3_class->printOut();
	//print_r($row);
	$pageLabel = $row['PageLabel'];
	if ($pageLabel == '1')
		echo 'SQLite test succeeded';
	else
		echo 'SQLite test failed';
	echo '<br>';

?>

Expected result:
----------------
Via a browser, we expect to see...

SQLite test succeeded

Actual result:
--------------
Note: My original health check script had some MySQL and MSSQL health checks that I removed in my example, so line 39 is no longer accurate.

Fatal error: Uncaught PDOException: open_basedir prohibits opening abb20htm.db3 in F:\Sites\ITMonitors\dbtests\default.php:39 Stack trace: #0 F:\Sites\ITMonitors\dbtests\default.php(39): PDO->__construct('sqlite:abb20htm...') #1 {main} thrown in F:\Sites\ITMonitors\dbtests\default.php on line 39  


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-19 14:20 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-10-19 14:20 UTC] cmb@php.net
Thanks for reporting!

I don't have a machine at hand where I could turn on
deduplication, but I suspect that this regression has been
introduced by fixing bug #79806[1].  Could you please check
whether adding "C:\System Volume Information" (or just C:\ for
quick testing) would solve the open_basedir issue, and that
everything with that SQLite3 database works like before?

[1] <http://git.php.net/?p=php-src.git;a=commit;h=d5b59b4303642adac91df2c93969a72bc0f5fa7d>
 [2020-10-19 15:06 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2020-10-19 15:06 UTC] cmb@php.net
Fiddling with the open_basedir setting is unlikely to change
anything.  More likely, the problem is that the code now basically
tries to open C:\System Volume Information, which is an
inaccessible system folder.  I'll work out a patch.

Would you be able to build a custom PHP for testing purposes?
 [2020-10-19 15:47 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #80258: Windows Deduplication Enabled, randon permission errors
On GitHub:  https://github.com/php/php-src/pull/6354
Patch:      https://github.com/php/php-src/pull/6354.patch
 [2020-10-19 16:02 UTC] josh dot manchester at dirxion dot com
I will see if I can work with our internal developers to make a new build. Typically I just download your precompiled builds.

Once I get a test build I also have to break an environment again as my original 2 problem servers had Deduplication disabled during my testing.
 [2020-10-19 17:41 UTC] cmb@php.net
I can roll a snapshot build.  Do you need the x64 or x86 variant?
 [2020-10-19 18:24 UTC] josh dot manchester at dirxion dot com
x64
 [2020-10-19 22:51 UTC] cmb@php.net
There is a snapshot build available[1].  It would be great if you
could check it out.

[1] <https://windows.php.net/downloads/snaps/ostc/80258/>.
 [2020-10-20 12:48 UTC] joshdmo at gmail dot com
-: josh dot manchester at dirxion dot com +: joshdmo at gmail dot com
 [2020-10-20 12:48 UTC] joshdmo at gmail dot com
I can confirm that this Dev build fixed the problem I was experiencing.
 [2020-10-20 13:00 UTC] cmb@php.net
Thanks for checking!
 [2020-10-26 10:23 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=848e24f24d7c05db04fe1ba87e6566a5c30323fd
Log: Fix #80258: Windows Deduplication Enabled, randon permission errors
 [2020-10-26 10:23 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 14:01:24 2020 UTC