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

Server error "Undefined array key "scheme"" #6496

Closed
wm-simon opened this issue Aug 15, 2022 · 6 comments · Fixed by #7173
Closed

Server error "Undefined array key "scheme"" #6496

wm-simon opened this issue Aug 15, 2022 · 6 comments · Fixed by #7173
Labels

Comments

@wm-simon
Copy link

wm-simon commented Aug 15, 2022

Bug description

When the entry gets saved, the cp shows a Server Error, although the changes are saved.

How to reproduce

/resources/blueprints/collections/pages/entry_link.yaml

title: Verlinkung
sections:
  main:
    display: Hauptteil
    fields:
      -
        handle: title
        field:
          type: text
          required: true
          localizable: true
          width: 50
          listable: true
          display: Titel
          instructions: 'Name in der Navigation'
          input_type: text
          validate:
            - required
      -
        handle: fa-icon
        field:
          placeholder: check
          prepend: fa-
          type: text
          width: 50
          listable: hidden
          display: FA-Icon
          instructions: '<a href="https://fontawesome.com/icons" target="_blank">Icon-Übersicht</a>'
          input_type: text
      -
        handle: redirect
        field:
          display: Weiterleitung
          type: link
          icon: link
          localizable: true
          listable: hidden
          width: 75
      -
        handle: target
        field:
          default: false
          display: 'Neuer Tab'
          type: toggle
          icon: toggle
          width: 25
          listable: hidden
          instructions_position: above
      -
        handle: introtext
        field: basis.introtext
  sidebar:
    display: Sidebar
    fields:
      -
        handle: slug
        field:
          type: slug
          localizable: true
          validate:
            - required
            - 'unique_entry_value:{collection},{id},{site}'
      -
        handle: parent
        field:
          type: entries
          collections:
            - pages
          max_items: 1
          listable: false
          localizable: true


Introtext part from /resources/fieldsets/basis.yaml

  -
    handle: introtext
    field:
      restrict: false
      automatic_line_breaks: true
      automatic_links: true
      escape_markup: false
      smartypants: false
      type: markdown
      localizable: true
      listable: hidden
      display: Introtext
      instructions_position: above
      antlers: false

Logs

[2022-08-15 09:01:38] production.ERROR: Undefined array key "scheme" {"userId":"8a455a2d-a4e1-4e9d-992c-87671109fc4e","exception":"[object] (ErrorException(code: 0): Undefined array key \"scheme\" at /var/www/vhosts/vendor/statamic/cms/src/StaticCaching/DefaultInvalidator.php:107)
[stacktrace]
#0 /var/www/vhosts/vendor/statamic/cms/src/StaticCaching/DefaultInvalidator.php(107): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /var/www/vhosts/vendor/statamic/cms/src/StaticCaching/DefaultInvalidator.php(55): Statamic\\StaticCaching\\DefaultInvalidator->splitUrlAndDomain()
#2 /var/www/vhosts/vendor/statamic/cms/src/StaticCaching/DefaultInvalidator.php(31): Statamic\\StaticCaching\\DefaultInvalidator->invalidateEntryUrls()
#3 /var/www/vhosts/vendor/statamic/cms/src/StaticCaching/Invalidate.php(61): Statamic\\StaticCaching\\DefaultInvalidator->invalidate()
#4 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Events/CallQueuedListener.php(107): Statamic\\StaticCaching\\Invalidate->invalidateEntry()
#5 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Events\\CallQueuedListener->handle()
#6 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#8 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#9 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\\Container\\BoundMethod::call()
#10 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call()
#11 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}()
#12 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#13 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then()
#14 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\\Bus\\Dispatcher->dispatchNow()
#15 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}()
#16 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\\Pipeline\\Pipeline->then()
#18 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware()
#19 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\\Queue\\CallQueuedHandler->call()
#20 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(43): Illuminate\\Queue\\Jobs\\Job->fire()
#21 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(57): Illuminate\\Queue\\SyncQueue->push()
#22 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(574): Illuminate\\Queue\\Queue->pushOn()
#23 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(498): Illuminate\\Events\\Dispatcher->queueHandler()
#24 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(424): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#25 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}()
#26 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(450): Illuminate\\Events\\Dispatcher->dispatch()
#27 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php(14): event()
#28 /var/www/vhosts/vendor/statamic/cms/src/Entries/Entry.php(332): Statamic\\Events\\Event::dispatch()
#29 /var/www/vhosts/vendor/statamic/cms/src/Http/Controllers/CP/Collections/EntriesController.php(240): Statamic\\Entries\\Entry->save()
#30 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Statamic\\Http\\Controllers\\CP\\Collections\\EntriesController->update()
#31 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()
#32 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#33 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#34 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\\Routing\\Route->run()
#35 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#36 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/CountUsers.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\CountUsers->handle()
#38 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/Localize.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\Localize->handle()
#40 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/Authorize.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\Authorize->handle()
#42 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/AddToasts.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\AddToasts->handle()
#44 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\AuthGuard->handle()
#46 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CP/ContactOutpost.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CP\\ContactOutpost->handle()
#48 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#50 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#52 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#54 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#56 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle()
#57 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#59 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#61 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/SwapExceptionHandler.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\SwapExceptionHandler->handle()
#63 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\\Pipeline\\Pipeline->then()
#65 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\\Routing\\Router->runRouteWithinStack()
#66 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\\Routing\\Router->runRoute()
#67 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\\Routing\\Router->dispatchToRoute()
#68 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\\Routing\\Router->dispatch()
#69 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#70 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#71 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\DisableFloc->handle()
#72 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#73 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CheckMultisite->handle()
#74 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#75 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle()
#76 /var/www/vhosts/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#77 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Statamic\\Http\\Middleware\\PoweredByHeader->handle()
#78 /var/www/vhosts/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#79 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#80 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#81 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#82 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#83 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#84 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#85 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#86 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#87 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#88 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#89 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#90 /var/www/vhosts/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#91 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle()
#92 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#93 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#94 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#95 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\\Pipeline\\Pipeline->then()
#96 /var/www/vhosts/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#97 /var/www/vhosts/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle()
#98 {main}
"}

Environment

Statamic 3.2.39 Pro
Laravel 6.20.44
PHP 8.0.22

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

@duncanmcclean
Copy link
Member

Seems related to this line in the static cache invalidation code: https://github.com/statamic/cms/blob/3.3/src/StaticCaching/DefaultInvalidator.php#L107

@jasonvarga
Copy link
Member

Can you show your config/statamic/sites.php file?

@wm-simon
Copy link
Author

Sure

    'sites' =>
    [
        'de' => [
            'name' => 'Deutsch',
            'locale' => 'de_DE.utf8',
            'url' => 'https://domain.com/',
        ],
        'en' => [
            'name' => 'Englisch',
            'locale' => 'en_US.utf8',
            'url' => 'https://domain.com/en/',
        ]
    ]

@jasonvarga
Copy link
Member

Odd. Do you think you could add info($url); on the line above this one?

$parsed = parse_url($url);

This file would be in vendor/statamic/cms/src/StaticCaching/DefaultInvalidator.php.

Try to save an entry again, then look in your log file. Specifically the line above the exception.

@wm-simon
Copy link
Author

[2022-08-15 22:55:52] production.INFO: /unternehmen/karriere/karriere-als-arbeitgeber  

It's the uri from the first child, not from the entry itself.
This is set in the parent, where the error is shown:

redirect: '@child'

// parent: /unternehmen/karriere (error)
// child: /unternehmen/karriere/karriere-als-arbeitgeber

@jasonvarga
Copy link
Member

That's helpful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants