When installing Drupal using drupal console, a number of log entries appear in dblog:
system 06/25/2016 - 10:51 update module installed. Anonymous (not verified)
locale 06/25/2016 - 10:51 1 disallowed HTML string(s) in files: translations:/… Anonymous (not verified)
locale 06/25/2016 - 10:51 Translations imported: 6735 added, 0 updated, 0 removed. Anonymous (not verified)
locale 06/25/2016 - 10:51 Import of string "Boeken hebben een hiërarchische… Anonymous (not verified)
When clicking any of these links, the following error occurs:
The website encountered an unexpected error. Please try again later.
InvalidArgumentException: The URI 'http://:/' is malformed. in Drupal\Core\Url::fromUri() (line 273 of core/lib/Drupal/Core/Url.php).
Drupal\dblog\Controller\DbLogController->eventDetails('43')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
SELECT location FROM `watchdog` where wid=1 LIMIT 1 returns http://:/.
$request->getUri() on line 113 in LoggerChannel.php returns 'http://:/' during installation.
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 2755497-20.patch | 2.27 KB | yogeshmpawar |
| #12 | 2755497-12.patch | 2.29 KB | mpp |
Comments
Comment #2
mpp commentedComment #3
mpp commentedinstalled Drupal with Drupal console
Comment #4
mpp commentedComment #5
mpp commentedComment #6
mpp commentedComment #7
mpp commentedComment #8
mpp commentedComment #9
mpp commentedComment #10
mpp commentedComment #11
dagmarThanks. So this is triggered in some specific scenario.
Could we have some test to ensure this is a bug and the provided patch fixes it?
Comment #12
mpp commented@dagmar, added tests.
FYI, when running requests using drush/drupal console there is no hostname available.
Symfony\Component\HttpFoundation\Request::getUri returns an invalid uri if there's no hostname/port/baseurl/path/query, namely "http(s)://:/".
Comment #13
mpp commentedComment #16
dagmarSorry for the delay. Inspecting the patch it seems it prevent this problem to occur in the future. But what about pre-existing broken links? If a user already installed the site with drupal console, this will not prevent to see the same errors.
Comment #17
mpp commentedThe issue was logged and solved 7 months ago. Logs are not permanent so how about committing this as an improvement for future sites so they are able to see what's in the logs?
Then perhaps open another issue if you feel like patching old logs.
Comment #18
ericpughI've successfully tested patch #12 on 8.2.6, logging some errors from a boilerplate Drupal Console command without the "Malformed URI" error. Thank you!
Comment #19
dagmarOk. This looks good, but needs a re-roll after the
array > []conversion.Comment #20
yogeshmpawarRerolled patch against the #19.
Comment #21
dagmarI created this ticket. https://github.com/hechoendrupal/drupal-console/issues/3221
Comment #22
dagmarI just created this: #2868725: Refactor how dblog module is rendering links in event details
Comment #23
dagmarI'm marking this as a duplicate of #2868725: Refactor how dblog module is rendering links in event details. We should work in a generic solution for several issues we have related the way dblog render links.