xylucien / MusicalKits_Converter

My personal Flask project
1 stars 0 forks source link

Cannot find lilypond #71

Closed xylucien closed 4 years ago

xylucien commented 4 years ago
[Thu Jul 23 05:09:31.983096 2020] [:error] [pid 5721] [remote 70.19.38.143:172] [2020-07-23 05:09:31,966] ERROR in app: Exception on /get-image/ [GET]
[Thu Jul 23 05:09:31.983122 2020] [:error] [pid 5721] [remote 70.19.38.143:172] Traceback (most recent call last):
[Thu Jul 23 05:09:31.983129 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/lily/translate.py", line 190, in setupTools
[Thu Jul 23 05:09:31.983133 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     proc = subprocess.Popen(command, stdout=subprocess.PIPE)
[Thu Jul 23 05:09:31.983137 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
[Thu Jul 23 05:09:31.983140 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     restore_signals, start_new_session)
[Thu Jul 23 05:09:31.983146 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
[Thu Jul 23 05:09:31.983149 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     raise child_exception_type(errno_num, err_msg, err_filename)
[Thu Jul 23 05:09:31.983155 2020] [:error] [pid 5721] [remote 70.19.38.143:172] PermissionError: [Errno 13] Permission denied: '/opt/python/bundle/3/app'
[Thu Jul 23 05:09:31.983159 2020] [:error] [pid 5721] [remote 70.19.38.143:172] 
[Thu Jul 23 05:09:31.983162 2020] [:error] [pid 5721] [remote 70.19.38.143:172] During handling of the above exception, another exception occurred:
[Thu Jul 23 05:09:31.983165 2020] [:error] [pid 5721] [remote 70.19.38.143:172] 
[Thu Jul 23 05:09:31.983168 2020] [:error] [pid 5721] [remote 70.19.38.143:172] Traceback (most recent call last):
[Thu Jul 23 05:09:31.983174 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 2311, in wsgi_app
[Thu Jul 23 05:09:31.983179 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     response = self.full_dispatch_request()
[Thu Jul 23 05:09:31.983183 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1834, in full_dispatch_request
[Thu Jul 23 05:09:31.983186 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     rv = self.handle_user_exception(e)
[Thu Jul 23 05:09:31.983189 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1737, in handle_user_exception
[Thu Jul 23 05:09:31.983192 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     reraise(exc_type, exc_value, tb)
[Thu Jul 23 05:09:31.983195 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/_compat.py", line 36, in reraise
[Thu Jul 23 05:09:31.983199 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     raise value
[Thu Jul 23 05:09:31.983202 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1832, in full_dispatch_request
[Thu Jul 23 05:09:31.983205 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     rv = self.dispatch_request()
[Thu Jul 23 05:09:31.983208 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1818, in dispatch_request
[Thu Jul 23 05:09:31.983212 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     return self.view_functions[rule.endpoint](**req.view_args)
[Thu Jul 23 05:09:31.983215 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/current/app/converter/generate_image.py", line 8, in generate_image
[Thu Jul 23 05:09:31.983219 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     converter.parse('result.abc').write('lilypond.png', 'result')
[Thu Jul 23 05:09:31.983222 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/stream/__init__.py", line 252, in write
[Thu Jul 23 05:09:31.983232 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     return super().write(*args, **kwargs)
[Thu Jul 23 05:09:31.983235 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/base.py", line 2562, in write
[Thu Jul 23 05:09:31.983238 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     return formatWriter.write(self, regularizedConverterFormat, fp, subformats, **keywords)
[Thu Jul 23 05:09:31.983241 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/converter/subConverters.py", line 414, in write
[Thu Jul 23 05:09:31.983244 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     conv = lily.translate.LilypondConverter()
[Thu Jul 23 05:09:31.983247 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/lily/translate.py", line 148, in __init__
[Thu Jul 23 05:09:31.983250 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     self.setupTools()
[Thu Jul 23 05:09:31.983253 2020] [:error] [pid 5721] [remote 70.19.38.143:172]   File "/opt/python/run/venv/local/lib/python3.6/site-packages/music21/lily/translate.py", line 195, in setupTools
[Thu Jul 23 05:09:31.983256 2020] [:error] [pid 5721] [remote 70.19.38.143:172]     "environment.UserSettings()['lilypondPath'] is set to find it.")
[Thu Jul 23 05:09:31.983265 2020] [:error] [pid 5721] [remote 70.19.38.143:172] music21.lily.translate.LilyTranslateException: Cannot find a copy of Lilypond installed on your system. Please be sure it is installed. And that your environment.UserSettings()['lilypondPath'] is set to find it.
xicheng87 commented 4 years ago

Maybe a path issue - ssh into the machine and see whether lilypond is installed?

xylucien commented 4 years ago

i see the problem - lilypond is not installed! more specifically, apt-get is not available on eb server.

xylucien commented 4 years ago

yum still works. the problem, however, is that lilypond cannot be found with yum command

xylucien commented 4 years ago

IT WORKS!!!

xicheng87 commented 4 years ago

How come I still get the following?

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
xylucien commented 4 years ago

http://musicxml2abc.musicalkits.me/ ?

it even works on my phone.

xicheng87 commented 4 years ago

http://musicxml2abc.musicalkits.me/get-image/

This is after getting "Get the Score Visualization"

xicheng87 commented 4 years ago

Can you try with this file? I got the error on my Mac's chrome browser. Can you check server logs?

BeetAnGeSample.musicxml.zip

xylucien commented 4 years ago

it seems that lilypond cannot process this file... I tried other several music XML files and it worked

i may try to change the image generator to musescore, which theoretically works much better

xicheng87 commented 4 years ago

Ok, I see that for some musicxml files it works, but for the one I sent you, and quite a few others it doesn't and crashes the server. We need to investigate these issues.

But good job on getting the initial steps work.

xicheng87 commented 4 years ago

We at least should catch error and report to user. The server cannot be crashed because of this.

xylucien commented 4 years ago

will fix this first.

xylucien commented 4 years ago

I am having trouble installing musescore - I can only get the AppImage. The install method on musescore.org does not work (amazon Linux uses Fedora)

xicheng87 commented 4 years ago

Let's leave the musicscore to a separate issue and deal with that later. Can we first fix the error handling of lilypond?

xylucien commented 4 years ago

yes, with the current update the website will never crash.

xylucien commented 4 years ago

it is really weird that some files work while others dont. When the error occurs it says must be str, not PosixPath

xicheng87 commented 4 years ago

well, that speaks the complexity of expressing music with computer files, and there are always bugs in software.

I think we should add tests to prevent regression. Furthermore, can you review the previous batches of changes and clean up stuff that are not needed? Let's bring the current version to stable, and then I have some front-end changes to propose.

xylucien commented 4 years ago

everything for now is clean. This should be a stable version (aka no website crashing)