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

LodgeitUpload: lexer[1][0] IndexError: tuple index out of range #258

Closed
Duckle29 opened this issue Dec 14, 2020 · 9 comments
Closed

LodgeitUpload: lexer[1][0] IndexError: tuple index out of range #258

Duckle29 opened this issue Dec 14, 2020 · 9 comments
Labels
Milestone

Comments

@Duckle29
Copy link
Contributor

Duckle29 commented Dec 14, 2020

Hi there.

In a personal server re-vamp, I decided I wanted to also have pasting available self-hosted, and I found this awesome project.
As I deploy my VPS mostly through ansible managed docker images, I wanted to do so for bepasty too.

In order to do this I looked around, and found a 5 year old image. I decided to try and move this image to the latest alpine, and have a scheduled github action to regularly(monthly) rebuild the image (to follow the latest pypi build of bepasty-server)

I however have run into some issues getting it running, and have gotten stuck at the following error when uWSGI tries to start:

Traceback (most recent call last):
  File "wsgi.py", line 4, in <module>
    from bepasty.app import create_app
  File "/usr/lib/python3.8/site-packages/bepasty/app.py", line 14, in <module>
    from .apis import blueprint as blueprint_apis
  File "/usr/lib/python3.8/site-packages/bepasty/apis/__init__.py", line 3, in <module>
    from .lodgeit import LodgeitUpload
  File "/usr/lib/python3.8/site-packages/bepasty/apis/lodgeit.py", line 15, in <module>
    class LodgeitUpload(MethodView):
  File "/usr/lib/python3.8/site-packages/bepasty/apis/lodgeit.py", line 25, in LodgeitUpload
    name = lexer[1][0]
IndexError: tuple index out of range
unable to load app 0 (mountpoint='') (callable not found or import error)

Any pointers in the right direction would be greatly appreciated :)

edit: docker image source is here https://github.com/Duckle29/bepasty-docker

@ThomasWaldmann
Copy link
Contributor

ThomasWaldmann commented Dec 14, 2020

I just merged a PR yesterday into master that fixes this. #256

Guess it is related to some recent change in pygments, so either using our master branch code or an older pygments release would both likely fix that.

@ThomasWaldmann ThomasWaldmann changed the title Failing to start on latest alpine (no lexers?) LodgeitUpload: lexer[1][0] IndexError: tuple index out of range Dec 14, 2020
@ThomasWaldmann ThomasWaldmann added this to the 1.0.0 milestone Dec 14, 2020
@ThomasWaldmann
Copy link
Contributor

Try: pygments<2.7.3

@Duckle29
Copy link
Contributor Author

That indeed fixed it for pip installs :)
I've tagged that as stable on my docker repo, and will try installing from git on the latest tag. Any way to use [magic] with the editable pip install?

@Duckle29
Copy link
Contributor Author

And installing the latest from git also works! Awesome, now I have exactly the pastebin I want with the deployment method I want :D

Test paste here https://paste.mikkel.cc/shzo9Dzo

Thanks for the help, and I'm happy to see that this is still actively maintained. Lots of other bins I looked at weren't.

@foosinn
Copy link

foosinn commented Jan 5, 2021

Any chance of a bugfix-release or new release? pip install bepasty without further options seems currently broken.

@ThomasWaldmann
Copy link
Contributor

@foosinn yes, i'll make a release soon.

meanwhile, you can just install the older pygments to make the last release work again, see above.

@reivilibre
Copy link

I just also ran into this. pygments<2.7.3 as an extra requirement seems to have indeed worked around the issue.

@mweinelt
Copy link

Downgrading pygments to a version before 2.7.4 should not be a recommended solution.

See pygments/pygments#1625 (CVE-2021-20270)

@ThomasWaldmann
Copy link
Contributor

@mweinelt just released 1.0.0. \o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants