The problem:
I have a python webapp running on heroku which creates a subprocess for communication with the Stockfish chess engine.
Everything JustWorks™ on my local machine, however upon attempting to deploy the project on Heroku, I get an error saying PermissionError: [Errno 13] Permission denied
Below, I have included the heroku logs from when I tried to deploy this.
I know other folks have heroku apps running the stockfish engine within the same dyno, however I haven't had much luck finding resources to assist me in getting it working. Any help is appreciated. Thanks!
The logs:
bash
2017-06-20T22:32:48.419694+00:00 heroku[web.1]: Starting process with command `python server.py`
2017-06-20T22:32:51.933668+00:00 app[web.1]: Traceback (most recent call last):
2017-06-20T22:32:51.933687+00:00 app[web.1]: File "server.py", line 23, in <module>
2017-06-20T22:32:51.933882+00:00 app[web.1]: engine = chess.uci.popen_engine(DIR_PATH + "/stockfish_8_x64")
2017-06-20T22:32:51.933884+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/chess/uci.py", line 1405, in popen_engine
2017-06-20T22:32:51.934623+00:00 app[web.1]: PopenProcess(engine, command, **kwargs)
2017-06-20T22:32:51.934625+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/chess/uci.py", line 404, in __init__
2017-06-20T22:32:51.934874+00:00 app[web.1]: self.process = subprocess.Popen(command, **popen_args)
2017-06-20T22:32:51.934877+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/subprocess.py", line 707, in __init__
2017-06-20T22:32:51.935286+00:00 app[web.1]: restore_signals, start_new_session)
2017-06-20T22:32:51.935288+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/subprocess.py", line 1326, in _execute_child
2017-06-20T22:32:51.935988+00:00 app[web.1]: raise child_exception_type(errno_num, err_msg)
2017-06-20T22:32:51.936008+00:00 app[web.1]: PermissionError: [Errno 13] Permission denied
2017-06-20T22:32:52.051035+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-20T22:32:52.035235+00:00 heroku[web.1]: Process exited with status 1