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

yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>' #576

Closed
cybrmakr opened this issue May 2, 2024 · 3 comments

Comments

@cybrmakr
Copy link

cybrmakr commented May 2, 2024

First of all, thank you for creating this project, I hope it will help us finding flats!
Right now though, I actually can't get the project up and running, the following error appears with these settings:

Python 3.11.7
CentOS 8 Stream

Copied config.yaml.dist into config.yaml and added Telegram config:

 telegram:
   bot_token: 7xxxxxxxx:Axxxxxxxxxxxx-Fxxxxxxxxxxx
   notify_with_images: true
   receiver_ids:
       - 4xxxxxxxx

There might be some issue with my dependency installation via pipenv install.

Part of error:

(flathunter) [centos@localhost flathunter]$ python flathunt.py 
...
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/parser.py", line 171, in parse_document_start
    raise ParserError(None, None,
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "/home/centos/Git/flathunter/config.yaml", line 10, column 1

Full error message:

(flathunter) [centos@localhost flathunter]$ python flathunt.py 
[2024/05/03 01:04:27|config.py               |INFO    ]: Using config path /home/centos/Git/flathunter/config.yaml
Traceback (most recent call last):
  File "/home/centos/Git/flathunter/flathunt.py", line 99, in <module>
    main()
  File "/home/centos/Git/flathunter/flathunt.py", line 53, in main
    config = Config(config_handle.name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/Git/flathunter/flathunter/config.py", line 430, in __init__
    config = yaml.safe_load(file)
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/__init__.py", line 125, in safe_load
    return load(stream, SafeLoader)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/composer.py", line 39, in get_single_node
    if not self.check_event(StreamEndEvent):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/home/centos/.local/share/virtualenvs/flathunter-RIm6_1UG/lib64/python3.11/site-packages/yaml/parser.py", line 171, in parse_document_start
    raise ParserError(None, None,
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "/home/centos/Git/flathunter/config.yaml", line 10, column 1
(flathunter) [centos@localhost flathunter]$ 
@cybrmakr
Copy link
Author

cybrmakr commented May 5, 2024

config.yaml.dist

I suggest to add a comment to the following line as it breaks the validity of the YAML file:

title: {crawler}: {title}

removing/commenting this line resolves the error described.

@codders
Copy link

codders commented May 9, 2024

Thanks for the report! I've updated the default config, and that should be fixed in the latest code (#586). Can you recheck and verify?

@codders
Copy link

codders commented May 13, 2024

Closing this as resolved. Please reopen if it turns out still to be an issue.

@codders codders closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants