Skip to content

Builds suddenly started failing a month ago with Stop Iteration error (Markdown docs) #5474

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

Closed
MikeTheWatchGuy opened this issue Mar 16, 2019 · 21 comments

Comments

@MikeTheWatchGuy
Copy link

Details

  • Read the Docs project URL:
    I've tried 2 different accounts thinking maybe it got corrupt.
    The latest one is here:
    https://readthedocs.org/projects/pysimplegui/

  • Build URL (if applicable):

  • Read the Docs username (if applicable):
    PySimpleGUI and MikeTheWatchGuy

Expected Result

I want the docs to PASS, not fail

Actual Result

I get a failure, even when using older docs. It seems to be happening due to you guys switching to Python 3.7 and that I'm using markdown instead of Sphinx

HELP! I've been struggling for weeks with this. I did see others with this problem and Issues claiming it's fixed, but it's not fixed for me. 😒

REALLY hoping someone can help.
Here's the typical error:

python /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/mkdocs build --clean --site-dir _build/html --config-file /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/checkouts/latest/mkdocs.yml
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/checkouts/latest/_build/html 
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/nav.py", line 337, in _follow
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/mkdocs", line 10, in <module>
    sys.exit(cli())
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/__main__.py", line 156, in build_command
    ), dirty=not clean)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/commands/build.py", line 282, in build
    build_pages(config, dirty=dirty)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/commands/build.py", line 213, in build_pages
    site_navigation = nav.SiteNavigation(config)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/nav.py", line 44, in __init__
    config, self.url_context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.7/site-packages/mkdocs/nav.py", line 392, in _generate_site_navigation
    config_line, url_context, config):
RuntimeError: generator raised StopIteration
@stsewd
Copy link
Member

stsewd commented Mar 17, 2019

You can update to a new version of mkdocs with a requirements file or downgrading the python version. You can do both things using a configuration file https://docs.readthedocs.io/en/stable/config-file/v2.html

Closing as duplicated of #5332

@stsewd stsewd closed this as completed Mar 17, 2019
@MikeTheWatchGuy
Copy link
Author

I've spent the past hour trying to figure out

  1. what the config file should have in it
  2. getting it to work

I just want things to work like they used to and now I've lost all of my online documentation.

Would it be possible to supply me with a file and instructions?

I created one based on the examples and put it in my home folder, but I got complaints, so I removed lines that it complained about until it's really in bad shape now.

All of my doc files are in a subfolder called docs.

Is there a generic file that I can get that will reverse the 3.7 upgrade and whatever else I need to modify to simply get my docs building?

Not meaning to be unappreciative, but I'm struggling to learn this config file.

I don't want to have to become an expert at readtheedoc config files.

If possible, I'm looking for a direct fix to the bug that was introduced when readthedocs went to 3.7. Perhaps something a step further than "you update the version of mkdocs using the requirements file."

I'm sorry to be such an moron on how to setup the various settings files.

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

This is a compatibility problem with the mkdocs version that is installed by default.

You can use a version compatible with python 3.7 https://docs.readthedocs.io/en/stable/guides/specifying-dependencies.html or just downgrade to 3.6

I can't give you a functional example of the config, because I don't know the current settings of your project.

But you need something like this

version: 2
mkdocs:
  configuration: mkdocs.yml

python:
   version: 3.6

@MikeTheWatchGuy
Copy link
Author

MikeTheWatchGuy commented Mar 18, 2019

What goes into the mkdocs.yml file?

Nevermind... I'm figuring out that part now....

@MikeTheWatchGuy
Copy link
Author

MikeTheWatchGuy commented Mar 18, 2019

Making progress?

Oh, by the way, I'm SUPER APPRECIATIVE of your help with this. Thank you for taking the time to write up instructions and to deal with my ineptitude.

I added your .yml file and I added a mkdocs one with my docs listed. Now I'm getting this error:

image

Read the Docs build information
Build id: 8774260
Project: pysimplegui
Version: latest
Commit: 9569acea12c8806d3ff8496eacb0e29c03e86954
Date: 2019-03-18T16:48:47.289144Z
State: finished
Success: False


[rtd-command-info] start-time: 2019-03-18T16:48:47.687407Z, end-time: 2019-03-18T16:48:47.701460Z, duration: 0, exit-code: 0
git remote set-url origin https://github.com/PySimpleGUI/PySimpleGUI


[rtd-command-info] start-time: 2019-03-18T16:48:47.790261Z, end-time: 2019-03-18T16:48:48.717984Z, duration: 0, exit-code: 0
git fetch --tags --prune --prune-tags --depth 50


[rtd-command-info] start-time: 2019-03-18T16:48:48.908597Z, end-time: 2019-03-18T16:48:48.941452Z, duration: 0, exit-code: 0
git checkout --force origin/master
HEAD is now at 9569ace Create mkdocs.yml

[rtd-command-info] start-time: 2019-03-18T16:48:49.005679Z, end-time: 2019-03-18T16:48:49.059643Z, duration: 0, exit-code: 0
git clean -d -f -f


[rtd-command-info] start-time: 2019-03-18T16:48:51.452639Z, end-time: 2019-03-18T16:48:56.888178Z, duration: 5, exit-code: 0
python3.6 -mvirtualenv --no-site-packages --no-download /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest
Using base prefix '/home/docs/.pyenv/versions/3.6.4'
New python executable in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/python3.6
Not overwriting existing python script /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/python (you must use /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/python3.6)
Installing setuptools, pip, wheel...
done.

[rtd-command-info] start-time: 2019-03-18T16:48:56.962207Z, end-time: 2019-03-18T16:48:57.972494Z, duration: 1, exit-code: 0
/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/.cache/pip pip
Requirement already up-to-date: pip in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (19.0.3)

[rtd-command-info] start-time: 2019-03-18T16:48:58.083008Z, end-time: 2019-03-18T16:49:01.443836Z, duration: 3, exit-code: 0
/home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/.cache/pip Pygments==2.2.0 setuptools<40 docutils==0.13.1 mock==1.0.1 pillow==2.6.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.5.4 recommonmark==0.4.0 mkdocs==0.17.3
Requirement already up-to-date: Pygments==2.2.0 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (2.2.0)
Collecting setuptools<40
  Using cached https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl
Requirement already up-to-date: docutils==0.13.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (0.13.1)
Requirement already up-to-date: mock==1.0.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (1.0.1)
Requirement already up-to-date: pillow==2.6.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (2.6.1)
Requirement already up-to-date: alabaster!=0.7.5,<0.8,>=0.7 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (0.7.12)
Requirement already up-to-date: commonmark==0.5.4 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (0.5.4)
Requirement already up-to-date: recommonmark==0.4.0 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (0.4.0)
Requirement already up-to-date: mkdocs==0.17.3 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (0.17.3)
Requirement already satisfied, skipping upgrade: Jinja2>=2.7.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (2.10)
Requirement already satisfied, skipping upgrade: PyYAML>=3.10 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (5.1)
Requirement already satisfied, skipping upgrade: click>=3.3 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (7.0)
Requirement already satisfied, skipping upgrade: Markdown>=2.3.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (3.0.1)
Requirement already satisfied, skipping upgrade: livereload>=2.5.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (2.6.0)
Requirement already satisfied, skipping upgrade: tornado<5.0,>=4.1 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from mkdocs==0.17.3) (4.5.3)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from Jinja2>=2.7.1->mkdocs==0.17.3) (1.1.1)
Requirement already satisfied, skipping upgrade: six in /home/docs/checkouts/readthedocs.org/user_builds/pysimplegui/envs/latest/lib/python3.6/site-packages (from livereload>=2.5.1->mkdocs==0.17.3) (1.12.0)
Installing collected packages: setuptools
  Found existing installation: setuptools 40.6.3
    Uninstalling setuptools-40.6.3:
      Successfully uninstalled setuptools-40.6.3
Successfully installed setuptools-39.2.0

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

So, I saw your builds, your latest successful build was using Sphinx https://readthedocs.org/projects/pysimplegui/builds/8767815/, then it changed to build witch mkdocs.

You can read our guides to start with sphinx using markdown https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html

or using markdown out of the box with mkdocs https://docs.readthedocs.io/en/stable/intro/getting-started-with-mkdocs.html

Just a few clarifications, when we don't find a conf.py file we generate one for the user (if the project is using sphinx) or we generate a mkdocs.yml if the user is using Mkdocs.

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

Just a few clarifications, when we don't find a conf.py file we generate one for the user (if the project is using sphinx) or we generate a mkdocs.yml if the user is using Mkdocs.

This "magic" is removed when using a configuration file, because there was a lot of confusion.

The other problem looks like something else, I'll take a look soon

@MikeTheWatchGuy
Copy link
Author

Yea, that Sphinx test was kinda invalid. 100% of my docs are markdown.

But it appears I've missed the links you've provided earlier. I was searching last night for tools to convert mkdown to sphinx but came up empty.

I did manage to create a standalone HTML version, but this is not at all what I want because I had to hand build it.

Previously I LOVED readthedocs! I mean, it did everything I needed... automagically.

Being illiterate in a technology like this is such a humbling position.

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

I saw the problem, your mkdocs.yml file isn't valid. You should use the one that is generated by mkdocs https://www.mkdocs.org/#getting-started mkdocs new .

But, there is a bug, we are failing with a generic error instead of pointing the user the error. I'm creating a new issue about that.

Previously I LOVED readthedocs! I mean, it did everything I needed... automagically.

We still do that, we only need to update the default version of mkdocs that is installed when the users don't have a configuration file #5332

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

Looks like the only required setting for mkdocs is

site_name: Youd project name

https://www.mkdocs.org/user-guide/configuration/

@MikeTheWatchGuy
Copy link
Author

I ran the mkdocs new and it generated that yml file. I'm afraid to change anything in it because....

It's working!!!!!

image

THANK YOU SO very much!

Man, I cannot thank you enough for your time. I know it's tedious to step a newbie through something like this, but you spent the time with me and sure appears to have FIXED it!!

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

Don't worry, it helps us to identify where to put better docs, and also I just discovered a bug in the meantime :)

@MikeTheWatchGuy
Copy link
Author

Yea, well, I know what it's like to support users through my project and it takes time and patience, both of which you showed lots of. It doesn't go unnoticed by most people has been my experience. If I could 'tip' you I would. Can I tip you? 😏

@MikeTheWatchGuy
Copy link
Author

Can I ask one more question?

I tried previously to have PDF files built in addition to the html. What ended up happening is that a PDF from August was the only thing shown to users to download.

So, I'm trying once again to get a PDF file generated. I have this setting checked in the Advanced Settings:
image

But, when I look at the docs, and I use the little drop-down controller in the bottom right corner, I don't see anything in there about a PDF being available:
image

Nor is there anything shown under the "Downloads" tab.

Is it possible for me to generate PDFs?

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

When you use mkdocs, we don't generate PDFs, that's a downside of mkdocs itself #1939.

What you are seeing is the PDF that was generated when you were using Sphinx, we are not cleaning those old PDFs when changing from sphinx to mkdocs #4764

@MikeTheWatchGuy
Copy link
Author

Again you come to my rescue!!

OK, one last one?

In my readme file, I have links to other documents that are on readthedocs. My Cookbook is an example.

My Readme File has this address:
https://pysimplegui.readthedocs.io/cookbook/
which now gives me a 404 error.

But when I access the cookbook from readthedocs using the tab at the top of the page, I get this address
https://pysimplegui.readthedocs.io/en/latest/cookbook/

Is there a setting that I have missed that allows the first address that I have listed?

@stsewd
Copy link
Member

stsewd commented Mar 18, 2019

The firs address https://pysimplegui.readthedocs.io/cookbook/ is when you set your project with this option https://docs.readthedocs.io/en/stable/single_version.html

It is used when you don't need versioning your docs.

@MikeTheWatchGuy
Copy link
Author

Dude, you're on FIRE!

I found the "single version" setting, checked it, and POOF all of my links start working again.

You're my hero!

@humitos
Copy link
Member

humitos commented Mar 20, 2019

If I could 'tip' you I would. Can I tip you? smirk

@MikeTheWatchGuy Yes! You can become a Gold User at https://readthedocs.org/accounts/gold/subscription/ 😄

@MikeTheWatchGuy
Copy link
Author

That's one expensive 'tip', but, what the heck, I signed up. You got me through several days of icky debugging of stuff I didn't/don't understand (ok, maybe a little better now).

You guys provide such a crucial service for me. I get comments every week, almost daily, and one of the things that's often brought up are my docs. Users claim they chose PySimpleGUI specifically because of those docs. And without readthedocs they would be "flat", without the Table of Contents on the left side.

Great suggestion. I'll pay for as long as I can afford to. Hopefully it'll be for a long time 😃

@humitos
Copy link
Member

humitos commented Mar 21, 2019

Thanks @MikeTheWatchGuy! My next beer will be in your name 😉

Keep documenting with us ❤️

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

3 participants