Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Session FileDriver unlink No such file or directory #8892

Closed
byazrail opened this issue May 13, 2024 · 1 comment
Closed

Bug: Session FileDriver unlink No such file or directory #8892

byazrail opened this issue May 13, 2024 · 1 comment

Comments

@byazrail
Copy link
Contributor

byazrail commented May 13, 2024

PHP Version

8.3

CodeIgniter4 Version

4.5.1

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

PostgreSQL

What happened?

When the session ends, it does not unlink even though there is a session file.

Steps to Reproduce

CRITICAL - 2024-05-14 02:04:57 --> unlink(/home/user/public_html/prod/writable/sessions/Cookie_f9591498be8fb280395b8eccfbcb8f69pq6brbe3cthpa3i5jokghvta2t3rknr9): No such file or directory
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler()
#1 /home/user/public_html/prod/core/Session/Handlers/FileHandler.php(306): unlink()
#2 [internal function]: CodeIgniter\Session\Handlers\FileHandler->destroy()
#3 /home/user/public_html/prod/core/Session/Session.php(457): session_regenerate_id()
#4 /home/user/public_html/prod/core/Session/Session.php(243): CodeIgniter\Session\Session->regenerate()
#5 /home/user/public_html/prod/core/Config/Services.php(714): CodeIgniter\Session\Session->start()
#6 /home/user/public_html/prod/core/Config/BaseService.php(100): CodeIgniter\Config\Services::session()
#7 /home/user/public_html/prod/core/Config/Services.php(699): CodeIgniter\Config\BaseService::getSharedInstance()
#8 /home/user/public_html/prod/app/Controllers/Core/CoreController.php(34): CodeIgniter\Config\Services::session()
#9 /home/user/public_html/prod/app/Controllers/Core/HomeController.php(36): App\Controllers\Core\CoreController->initController()
#10 /home/user/public_html/prod/app/Controllers/Home.php(9): App\Controllers\Core\HomeController->initController()
#11 /home/user/public_html/prod/core/CodeIgniter.php(909): App\Controllers\Home->initController()
#12 /home/user/public_html/prod/core/CodeIgniter.php(969): CodeIgniter\CodeIgniter->createController()
#13 /home/user/public_html/prod/core/CodeIgniter.php(349): CodeIgniter\CodeIgniter->display404errors()
#14 /home/user/public_html/prod/public/index.php(115): CodeIgniter\CodeIgniter->run()
#15 /home/user/public_html/prod/rewrite.php(45): require_once('/home/user/pub...')
ls -l /home/user/public_html/prod/writable/sessions/Cookie_f9591498be8fb280395b8eccfbcb8f69pq6brbe3cthpa3i5jokghvta2t3rknr9
-rw------- 1 user user 34 May 14 02:04 /home/user/public_html/prod/writable/sessions/Cookie_f9591498be8fb280395b8eccfbcb8f69pq6brbe3cthpa3i5jokghvta2t3rknr9

cat /home/user/public_html/prod/writable/sessions/Cookie_f9591498be8fb280395b8eccfbcb8f69pq6brbe3cthpa3i5jokghvta2t3rknr9
__ci_last_regenerate|i:1715641497;

Expected Output

	public function destroy($sessionId): bool
	{
		if ($this->close())
		{
			return is_file($this->filePath . $sessionId)
				? (unlink($this->filePath . $sessionId) && $this->destroyCookie()) : true;
		}

		if ($this->filePath !== null)
		{
			clearstatcache();

			return is_file($this->filePath . $sessionId)
				? (unlink($this->filePath . $sessionId) && $this->destroyCookie()) : true;
		}

		return false;
	}

Anything else?

I also removed the warnings, but I still get this error.
What should be done? Do you think this is a bug?

@byazrail byazrail added the bug Verified issues on the current code behavior or pull requests that will fix them label May 13, 2024
@kenjis kenjis removed the bug Verified issues on the current code behavior or pull requests that will fix them label May 14, 2024
@kenjis
Copy link
Member

kenjis commented May 14, 2024

This is not a bug. It seems there is something wrong with your server configuration.

We use GitHub issues to track BUGS and to track approved DEVELOPMENT work packages. We use our forum to provide SUPPORT and to discuss FEATURE REQUESTS.

@kenjis kenjis closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants