I was manually editing a file in my staging directory to test a patch: #1821548: Add a "diff" of some kind to the CMI UI. Granted, I should not ever do this in real life. But the resulting error when going to admin/config/development/sync was:

Error message
Symfony\Component\Yaml\Exception\ParseException: Malformed inline YAML string ({ ¢ }) at line 13 (near "roles: { ¢ }"). in Symfony\Component\Yaml\Inline::parseScalar() (line 219 of /Users/webchick/Sites/8.x/core/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php).
The website has encountered an error. Please try again later.

It seems like:

1) There should be some more graceful error handling here rather than just barfing out basically a "cannot recover" style error.
2) That error message should give me the file name (staging/block.block.bartik.powered.yml) so I know where to start looking.

Files: 
CommentFileSizeAuthor
#6 1920838-6.patch942 bytesmartin107
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,168 pass(es), 1 fail(s), and 0 exception(s). View
#3 1920838-3.patch882 bytesswentel
PASSED: [[SimpleTest]]: [MySQL] 59,242 pass(es). View

Comments

dreftymac’s picture

Just out of curiosity, in troubleshooting the source YAML file, did looking at the stack trace help to identify which file was the culprit?

alexpott’s picture

Priority: Normal » Major

This should be a major. The error message needs to tell you which YAML file is causing the issue

swentel’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
882 bytes
PASSED: [[SimpleTest]]: [MySQL] 59,242 pass(es). View

Something in the lines of this ?

This then shows the configuration screen though, so I'm not sure whether we really want that to happen.

swentel’s picture

Guess the drupal_set_message() isn't really a fancy solution here though .. :)

dawehner’s picture

Did anyone considered to file an upstream issue?

martin107’s picture

FileSize
942 bytes
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,168 pass(es), 1 fail(s), and 0 exception(s). View

Reroll.

alexpott’s picture

@dawehner we're reading the file and the file name is what is useful so I don't think this can be done upstream.

alexpott’s picture

+++ b/core/lib/Drupal/Core/Config/FileStorage.php
@@ -85,9 +86,13 @@ public function read($name) {
+      drupal_set_message($e->getMessage() . ' in file ' . $name);

I would prefer to throw an exception here rather than using dsm().

swentel’s picture

Yeah, that makes more sense and catch the exception gracefully in places where we can. The dsm indeed does not belong this file.

Status: Needs review » Needs work

The last submitted patch, 6: 1920838-6.patch, failed testing.

alexpott’s picture

karthik9’s picture

Fatal error: Unsupported operand types in /var/www/html/core/lib/Drupal/Core/Routing/RouteBuilder.php on line 175.I get this message every time i clear all cache on the development/performance