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

Symfony YAML incompatibility issues with other Nextcloud apps #121

Open
matt-horwood-mayden opened this issue Apr 1, 2020 · 3 comments
Open

Comments

@matt-horwood-mayden
Copy link

Morning,
I seem to have an issue with my sites, have had a look at the error dump and not sure if my setup or code.

OS: Rasbian 9.11
nextcloud: 18.0.3 (upgrade)
Pico CMS: 1.0.5
Web server: Nginx 1.16.0 (separate server to PHP)
PHP-FPM: 7.2.27 (separate server to Nginx)
MySQL: MariaDB 10.3.22 (separate to PHP & Nginx)

Error in NC log

{
  "reqId": "QOC1a6tLmWIGOvr7makP",
  "level": 3,
  "time": "2020-04-01 07:26:35",
  "remoteAddr": "CLI_IP",
  "user": "USERNAME",
  "app": "cms_pico",
  "method": "GET",
  "url": "/index.php/apps/cms_pico/pico_proxy/SITE",
  "message": {
    "Exception": "OCA\\CMSPico\\Exceptions\\PicoRuntimeException",
    "Message": "The reserved indicator \"%\" cannot start a plain scalar; you need to quote the scalar at line 15 (near \"                                    #     See https://php.net/manual/en/function.strftime.php for more info\").",
    "Code": 0,
    "Trace": [
      {
        "file": "/srv/www/nextcloud/apps/cms_pico/lib/Service/WebsitesService.php",
        "line": 282,
        "function": "getPage",
        "class": "OCA\\CMSPico\\Service\\PicoService",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\CMSPico\\Model\\Website"
          }
        ]
      },
      {
        "file": "/srv/www/nextcloud/apps/cms_pico/lib/Controller/PicoController.php",
        "line": 108,
        "function": "getPage",
        "class": "OCA\\CMSPico\\Service\\WebsitesService",
        "type": "->",
        "args": [
          "SITE",
          "",
          "USERNAME",
          true
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 170,
        "function": "getPage",
        "class": "OCA\\CMSPico\\Controller\\PicoController",
        "type": "->",
        "args": [
          "SITE",
          "",
          true
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 99,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\CMSPico\\Controller\\PicoController"
          },
          "getPage"
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 125,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\CMSPico\\Controller\\PicoController"
          },
          "getPage"
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
        "line": 47,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\CMSPico\\Controller\\PicoController",
          "getPage",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "page": "",
            "proxyRequest": true,
            "site": "SITE",
            "_route": "cms_pico.Pico.getPageProxy"
          }
        ]
      },
      {
        "function": "__invoke",
        "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
        "type": "->",
        "args": [
          {
            "page": "",
            "proxyRequest": true,
            "site": "SITE",
            "_route": "cms_pico.Pico.getPageProxy"
          }
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/private/Route/Router.php",
        "line": 299,
        "function": "call_user_func",
        "args": [
          {
            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
          },
          {
            "page": "",
            "proxyRequest": true,
            "site": "SITE",
            "_route": "cms_pico.Pico.getPageProxy"
          }
        ]
      },
      {
        "file": "/srv/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/cms_pico/pico_proxy/SITE"
        ]
      },
      {
        "file": "/srv/www/nextcloud/index.php",
        "line": 38,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/srv/www/nextcloud/apps/cms_pico/lib/Service/PicoService.php",
    "Line": 157,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36 OPR/67.0.3575.79",
  "version": "18.0.3.0"
}
@PhrozenByte
Copy link
Collaborator

PhrozenByte commented Apr 1, 2020

In some way it's the same issue as with #97: Some other Nextcloud app also ships Symfony YAML and replaces the one used by Pico. Since Symfony YAML does a pretty good job in maintaining BC users don't experience problems too often, but here's one of these cases.

Symfony YAML changed its behaviour and no longer allows unquoted strings to start with a %. You'll have to check all YAML headers of your .md files for any meta variable starting with a % and quote it with ". Also check nextcloud/data/appdata_*/cms_pico/config/config.yml. For example, replace date_format: %D %T by date_format: "%D %T".

This is indeed a bug, but not really the fault of Pico CMS for Nextcloud, but of the whole app infrastructure of Nextcloud. We unfortunately can't do anything about it at the moment 😒 Also see #97, it's basically the same cause.

@PhrozenByte PhrozenByte changed the title Issue after upgrade to NC 18.0.3 and CMS 1.0.5 Symfony YAML doesn't allow unquoted strings to start with a '%' Apr 1, 2020
@matt-horwood-mayden
Copy link
Author

Thanks for your investigations, I can confirm that the issue was in my appdata_*/cms_pico/config/config.yml the very line about date format.

now sorted!

@PhrozenByte
Copy link
Collaborator

Will keep this open as with #97

@PhrozenByte PhrozenByte changed the title Symfony YAML doesn't allow unquoted strings to start with a '%' Symfony YAML incompatibility issues with other Nextcloud apps Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants