getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.54k stars 1.81k forks source link

what's causing this error? #2495

Closed JoshuaACasey closed 5 years ago

JoshuaACasey commented 5 years ago

Can't figure out what is causing this & how to fix it. Especially because I disabled all the feed related config options because having them enabled was causing issues (disabling fixed it)

Running with gitlab-runner 11.5.0 (3afdaba6)
  on docker-auto-scale 72989761
Using Docker executor with image python:3.6-alpine ...
Pulling docker image python:3.6-alpine ...
Using docker image sha256:1d981af1e3b42857690b249ddc52506bda9dfda452aa624d494ad781131e5a64 for python:3.6-alpine ...
Running on runner-72989761-project-1479325-concurrent-0 via runner-72989761-srm-1544954075-027ffadd...
Cloning repository...
Cloning into '/builds/JoshuaACasey/joshuacasey.net'...
Checking out 9d5fb892 as master...
Skipping Git submodules setup
$ pip install -r requirements.txt
Collecting pelican==3.7.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/82/62/6a81e2f2c8f20a80643d78ed93de42813c4decc0e3fc341e76106e0f881b/pelican-3.7.1-py2.py3-none-any.whl (134kB)
Collecting markdown (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/7a/6b/5600647404ba15545ec37d2f7f58844d690baf2f81f3a60b862e48f29287/Markdown-3.0.1-py2.py3-none-any.whl (89kB)
Collecting pelican_advance_embed_tweet (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/96/f7/a2daf9ce8e515ab056ab120b94e7403eb60c9535edd7111ffd6abe08fd2f/pelican_advance_embed_tweet-1.1.3-py2.py3-none-any.whl
Collecting blinker (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz (111kB)
Collecting docutils (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
Collecting unidecode (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/31/39/53096f9217b057cb049fe872b7fc7ce799a1a89b76cf917d9639e7a558b5/Unidecode-1.0.23-py2.py3-none-any.whl (237kB)
Collecting pygments (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/fc/41/4f900a7852e25bb9350b4e3ee8c4aba0ee32abefd401456962b25f954823/Pygments-2.3.0-py2.py3-none-any.whl (845kB)
Collecting feedgenerator>=1.9 (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/eb/02/7069b3dbc6ea92f034e07f9f9adc2193cd02d1aedf2cf9ec71150102a964/feedgenerator-1.9.tar.gz (4.1MB)
Collecting pytz>=0a (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl (506kB)
Collecting six>=1.4 (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting jinja2>=2.7 (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
Collecting python-dateutil (from pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
Collecting MarkupSafe>=0.23 (from jinja2>=2.7->pelican==3.7.1->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ac/7e/1b4c2e05809a4414ebce0892fe1e32c14ace86ca7d50c70f00979ca9b3a3/MarkupSafe-1.1.0.tar.gz
Building wheels for collected packages: blinker, feedgenerator, MarkupSafe
  Running setup.py bdist_wheel for blinker: started
  Running setup.py bdist_wheel for blinker: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/92/a0/00/8690a57883956a301d91cf4ec999cc0b258b01e3f548f86e89
  Running setup.py bdist_wheel for feedgenerator: started
  Running setup.py bdist_wheel for feedgenerator: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/ac/c9/63/61e224fe1b2442b36e18f2e1c13b97fa4ce3ba7211d92f9401
  Running setup.py bdist_wheel for MarkupSafe: started
  Running setup.py bdist_wheel for MarkupSafe: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/81/23/64/51895ea52825dc116a55f37043f49be0939bcf603de54e5cde
Successfully built blinker feedgenerator MarkupSafe
Installing collected packages: blinker, docutils, unidecode, pygments, pytz, six, feedgenerator, MarkupSafe, jinja2, python-dateutil, pelican, markdown, pelican-advance-embed-tweet
Successfully installed MarkupSafe-1.1.0 blinker-1.4 docutils-0.14 feedgenerator-1.9 jinja2-2.10 markdown-3.0.1 pelican-3.7.1 pelican-advance-embed-tweet-1.1.3 pygments-2.3.0 python-dateutil-2.7.5 pytz-2018.7 six-1.12.0 unidecode-1.0.23
$ pelican -D -s publishconf.py
DEBUG: Pelican version: 3.7.1
DEBUG: Python version: 3.6.7
DEBUG: Temporarily adding PLUGIN_PATHS to system path
DEBUG: Loading plugin `tag_cloud`
DEBUG: Registering plugin `tag_cloud`
DEBUG: Loading plugin `sitemap`
DEBUG: Registering plugin `sitemap`
DEBUG: Loading plugin `i18n_subsites`
DEBUG: Registering plugin `i18n_subsites`
DEBUG: Loading plugin `pelican_advance_embed_tweet`
DEBUG: Registering plugin `pelican_advance_embed_tweet`
DEBUG: Restoring system path
DEBUG: Found generator: <class 'sitemap.sitemap.SitemapGenerator'>
DEBUG: Template list: ['!simple/archives.html', '!simple/article.html', '!simple/author.html', '!simple/authors.html', '!simple/base.html', '!simple/categories.html', '!simple/category.html', '!simple/gosquared.html', '!simple/index.html', '!simple/page.html', '!simple/pagination.html', '!simple/period_archives.html', '!simple/tag.html', '!simple/tags.html', '!simple/translations.html', 'archives.html', 'article.html', 'article_list.html', 'author.html', 'authors.html', 'base.html', 'categories.html', 'category.html', 'gosquared.html', 'includes/aboutme.html', 'includes/addthis.html', 'includes/article_info.html', 'includes/banner.html', 'includes/cc-license.html', 'includes/comment_count.html', 'includes/comments.html', 'includes/disqus_script.html', 'includes/footer.html', 'includes/ga.html', 'includes/liquid_tags_nb_footer.html', 'includes/liquid_tags_nb_header.html', 'includes/minify_tipuesearch.html', 'includes/pagination.html', 'includes/piwik.html', 'includes/related-posts.html', 'includes/series.html', 'includes/shariff.html', 'includes/show_source.html', 'includes/sidebar.html', 'includes/sidebar/archive.html', 'includes/sidebar/article-li.html', 'includes/sidebar/authors.html', 'includes/sidebar/categories.html', 'includes/sidebar/github-js.html', 'includes/sidebar/github.html', 'includes/sidebar/images.html', 'includes/sidebar/links.html', 'includes/sidebar/macros.jinja', 'includes/sidebar/recent_posts.html', 'includes/sidebar/series.html', 'includes/sidebar/show_source.html', 'includes/sidebar/social.html', 'includes/sidebar/tag_cloud.html', 'includes/sidebar/twitter_timeline.html', 'includes/taglist.html', 'includes/translations.html', 'includes/twitter_cards.html', 'index.html', 'page.html', 'pagination.html', 'period_archives.html', 'search.html', 'tag.html', 'tags.html', 'translations.html']
DEBUG: Read file newpost_template.md -> Article
DEBUG: Signal article_generator_preread.send(ArticlesGenerator)
DEBUG: Successfuly imported extension module "markdown.extensions.codehilite".
DEBUG: Successfully loaded extension "markdown.extensions.codehilite.CodeHiliteExtension".
DEBUG: Successfuly imported extension module "markdown.extensions.extra".
DEBUG: Successfully loaded extension "markdown.extensions.fenced_code.FencedCodeExtension".
DEBUG: Successfully loaded extension "markdown.extensions.footnotes.FootnoteExtension".
DEBUG: Successfully loaded extension "markdown.extensions.attr_list.AttrListExtension".
DEBUG: Successfully loaded extension "markdown.extensions.def_list.DefListExtension".
DEBUG: Successfully loaded extension "markdown.extensions.tables.TableExtension".
DEBUG: Successfully loaded extension "markdown.extensions.abbr.AbbrExtension".
DEBUG: Successfully loaded extension "markdown.extensions.extra.ExtraExtension".
DEBUG: Successfuly imported extension module "markdown.extensions.meta".
DEBUG: Successfully loaded extension "markdown.extensions.meta.MetaExtension".
DEBUG: Signal article_generator_context.send(ArticlesGenerator, <metadata>)
ERROR: Unknown status 'hidden' for file ./newpost_template.md, skipping it.
DEBUG: Read file 2018-12-14.md -> Article
DEBUG: Read file pages/resume.md -> Page
DEBUG: Signal page_generator_preread.send(PagesGenerator)
DEBUG: Signal page_generator_context.send(PagesGenerator, <metadata>)
DEBUG: Read file pages/home.md -> Page
DEBUG: Read file pages/newpage_template.md -> Page
DEBUG: Read file pages/contact.md -> Page
DEBUG: Read file pages/about.md -> Page
DEBUG: Read file extra/robots.txt -> Static
DEBUG: Signal static_generator_preread.send(StaticGenerator)
DEBUG: Signal static_generator_context.send(StaticGenerator, <metadata>)
DEBUG: Read file extra/favicon.ico -> Static
DEBUG: Read file extra/keybase.txt -> Static
DEBUG: i18n: Updating cross-site links and context of all generators.
-> Writing /builds/JoshuaACasey/joshuacasey.net/public/feeds/all.atom.xml
-> Writing /builds/JoshuaACasey/joshuacasey.net/public/feeds/personal.atom.xml
-> Writing /builds/JoshuaACasey/joshuacasey.net/public/feeds/joshua-casey.atom.xml
-> Writing /builds/JoshuaACasey/joshuacasey.net/public/feeds/joshua-casey.rss.xml
CRITICAL: ValueError: too many values to unpack (expected 2)
Traceback (most recent call last):
  File "/usr/local/bin/pelican", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/pelican/__init__.py", line 487, in main
    pelican.run()
  File "/usr/local/lib/python3.6/site-packages/pelican/__init__.py", line 179, in run
    p.generate_output(writer)
  File "/usr/local/lib/python3.6/site-packages/pelican/generators.py", line 600, in generate_output
    self.generate_pages(writer)
  File "/usr/local/lib/python3.6/site-packages/pelican/generators.py", line 494, in generate_pages
    self.generate_articles(write)
  File "/usr/local/lib/python3.6/site-packages/pelican/generators.py", line 372, in generate_articles
    blog=True)
  File "/usr/local/lib/python3.6/site-packages/pelican/writers.py", line 230, in write_file
    override_output)
  File "/usr/local/lib/python3.6/site-packages/pelican/writers.py", line 171, in _write_file
    output = template.render(localcontext)
  File "/usr/local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/builds/JoshuaACasey/joshuacasey.net/pelican-bootstrap3/templates/article.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/builds/JoshuaACasey/joshuacasey.net/pelican-bootstrap3/templates/base.html", line 198, in top-level template code
    {% include 'includes/sidebar.html' %}
  File "/builds/JoshuaACasey/joshuacasey.net/pelican-bootstrap3/templates/includes/sidebar.html", line 13, in top-level template code
    {% include 'includes/sidebar/links.html' %}
  File "/builds/JoshuaACasey/joshuacasey.net/pelican-bootstrap3/templates/includes/sidebar/links.html", line 8, in top-level template code
    {% for name, link in LINKS %}
ValueError: too many values to unpack (expected 2)
ERROR: Job failed: exit code 1
bryanbrattlof commented 5 years ago

Hi @jacnoc

What does your LINKS setting look like? To me, this is likely an error in how that's setup.

It should be a tuple full of tuples with 2 string it in, or something like this

LINKS = (
    ('Pelican', 'http://getpelican.com/'),
    ('Python.org', 'http://python.org/'),
    ('jinja2', 'http://jinja.poco.org/'),
    ('You can modify those links in your config file', '#'),
)

If we have too many or too few, python get confused when it tries to unpack the tuple in the

{% for name, link in LINKS %}

part of the theme.

JoshuaACasey commented 5 years ago

I use to have LINKS commented out but I uncommented it yesterday and reduced it from 3 to 1. LINKS = (('Reddit', 'https://reddit.com/r/JoshuaCasey'))

bryanbrattlof commented 5 years ago

Oh, This is Python syntax weirdness with tuples.

With single element tuples you need a trailing comma.

So your LINKS settings should be something like this:

LINKS = (('Reddit', 'https://reddit.com/r/JoshuaCasey'),)
JoshuaACasey commented 5 years ago

cool. that fixed it. Thanks for sharing knowledge. So dumb that it's something as stupid as a damn comma.