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

[WiP] Worker mode #9

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

back-2-95
Copy link
Contributor

@back-2-95 back-2-95 commented Nov 14, 2022

Drupal responds with FRANKENPHP_CONFIG commented out, otherwise not.

When checking https://localhost headers it seems to responds somewhat but nothing gets to browser:

HTTP/1.1 302 Found
Alt-Svc: h3=":443"; ma=2592000
Cache-Control: no-cache, private
Content-Length: 314
Content-Type: text/html; charset=UTF-8
Date: Mon, 14 Nov 2022 05:29:29 GMT
Location: /core/install.php
Server: Caddy
X-Powered-By: PHP/8.2.0RC5

@back-2-95
Copy link
Contributor Author

Could you @dunglas checkout this PR and check if you can see what could be next steps?

@dunglas
Copy link
Owner

dunglas commented Nov 14, 2022

Unfortunately I don't know Drupal enough... Maybe the issue is that install.php cannot be called?

@back-2-95
Copy link
Contributor Author

Aah, good point. So that would mean... Drupal specific Caddy config 🤔

@back-2-95
Copy link
Contributor Author

But but, it works then not in worker mode... so cannot be Caddy config, right?

@dunglas
Copy link
Owner

dunglas commented Nov 14, 2022

I think that we're hitting a known bug: the normal mode doesn't work anymore when a worker is started. Here the worker starts index.php, but the installer redirects to install.php, which hangs forever.

We need to fix this in FrankenPHP directly, theoretically normal scripts should work even when workers are started.

@dunglas
Copy link
Owner

dunglas commented Nov 14, 2022

Could you try if dunglas/frankenphp@878a30d fixes the issue with the installer, please? Than you!

@back-2-95
Copy link
Contributor Author

back-2-95 commented Nov 15, 2022

@dunglas now I was able to run install process (install.php) without errors and I got to homepage. After that I get very weird effects:

After installation in complete, it logs me in as administrator and I was able to see frontpage before first page change / refresh. Then I just get this:

Fatal error: Uncaught RuntimeException: Failed to start the session. in /opt/drupal/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:176 Stack trace:
#0 /opt/drupal/web/core/lib/Drupal/Core/Session/SessionManager.php(144): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
#1 /opt/drupal/web/core/lib/Drupal/Core/Session/SessionManager.php(109): Drupal\Core\Session\SessionManager->startNow() #2 /opt/drupal/vendor/symfony/http-foundation/Session/Session.php(62): Drupal\Core\Session\SessionManager->start()
#3 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(54): Symfony\Component\HttpFoundation\Session\Session->start()
#4 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#5 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#6 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#7 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#8 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /opt/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(675): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /opt/drupal/vendor/runtime/frankenphp-symfony/src/Runner.php(35): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#12 [internal function]: Runtime\FrankenPhpSymfony\Runner->Runtime\FrankenPhpSymfony\{closure}()
#13 /opt/drupal/vendor/runtime/frankenphp-symfony/src/Runner.php(30): frankenphp_handle_request(Object(Closure))
#14 /opt/drupal/vendor/autoload_runtime.php(36): Runtime\FrankenPhpSymfony\Runner->run()
#15 /opt/drupal/web/index.php(5): require_once('/opt/drupal/ven...')
#16 {main} thrown in /opt/drupal/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php on line 176

Ok, then I though I'll visit the site as anonymous user with another browser. Well I get the site but it loads randomly between 2 pages on every url. And weirdly shows me as logged in user. That cannot be changed even if I clear all cache from browser (cache, logins etc).

@dunglas
Copy link
Owner

dunglas commented Nov 15, 2022

This looks related to dunglas/frankenphp#85

@back-2-95
Copy link
Contributor Author

Yup. Drupal stores sessions by default to database.

@back-2-95 back-2-95 mentioned this pull request Oct 6, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants