riasvdv/statamic-redirect

Error ParseException: Unable to parse yaml

onelovefame opened this issue · 2 comments

Hello,

sometimes we get a 500 on the redirect page in the control panel (/cp//redirect/dashboard) due to yaml parsing errors.

It seems that sometimes the user agent string in the _hits files causes problems.
Here is an example of the yaml entry causing problems:

`

timestamp: 1663207255 
   data: 
      userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36'
  ip: 20.224.153.230
  referer: null 
.108 Safari/537.36'
  ip: 51.142.142.23
  referer: null

`
Here is the entire yaml file as txt:
d6be4b6b-e3a1-43b4-a850-7ba8163a3dac_hits.txt

When I look at the file with an editor, I see strange characters:
MicrosoftTeams-image

At the moment we have created a script to parse the yaml files and are manually fixing the problems in the files. Any idea where this could happen? - I'd be happy to take a deeper look if needed.

Hi, which version of Redirect are you using? The newest version doesn't use yaml anymore for storing the errors & hits but sqlite instead.

I've changed this mostly because of issues like this.

We are currently using version 1.0.3. I will then update to version 2.* and assume that this will solve the problem.

If the problem persists, I would reopen the issue - thank you.