Replit Failed to Deploy

Problem description:
This project (https://replit.com/@latinlens/SD-Test) works properly in the console, and with ‘Always On’ at the repl.co, but will not deploy. I have isolated the problem to two lines of code which the Deployment cannot run.

Expected behavior:
When you hit ‘run’ it should serve the main web page route (‘/’) and should call these two lines of code and display their results, just as it does when you run it in the console.

Actual behavior:
Press ‘Deploy’ and the deployment fails.

Steps to reproduce:
Go to this replit https://replit.com/@latinlens/SD-Test, fork it, and deploy. It produces an error - seems to be a file not found error. However, the same lines of code work when you run the Replit from the console.

The code that will not execute in Deployment is on lines 124 and 125 in main.py:

  result1 = subprocess.check_output(["bin/meanings", "salve"], text=True, cwd='whitakers-words') 
  result2 = subprocess.check_output(['./words','~E','man'], text=True, cwd='e2l')

Error message at deployment time:

ERROR:main:Exception on / [GET]
    rv = self.handle_user_exception(e)
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/subprocess.py", line 971, in __init__
Traceback (most recent call last):
    response = self.full_dispatch_request()
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/runner/0aa32fd9-7daa-4e6c-8a59-cfe52a0768ab/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
  File "/home/runner/0aa32fd9-7daa-4e6c-8a59-cfe52a0768ab/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/subprocess.py", line 503, in run
    rv = self.dispatch_request()
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'bin/meanings'
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/subprocess.py", line 421, in check_output
    self._execute_child(args, executable, preexec_fn, close_fds,
error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on https://ask.replit.com/c/help/13 and a staff member will take a look. - 2023-11-01T16:07:45.726Z

thanks in advance for any help.

Browser:
Brave
OS:
Mac OS.
Plan (Free, Hacker, Pro Plan):
Hacker

Latinlens,

Thank you for letting know about this issue. I am going to try to reproduce the issue and I will let you know.

1 Like

Latinlens,

Would you be able to make this Repl public so that I can fork it and test?

1 Like

Hello, yes, sorry! I didn’t see your reply until just now. I have made the replit public. Thanks for responding.

1 Like

Debugging the deployment version is challenging! Using a series of tests and python’s raise to send myself error messages from within deployment, I have been able to ascertain that the directories and files I am trying to call with subprocess do in fact exist, and are in fact executable. Nevertheless python raises the file not found error as indicated above.

Is this forum the right way to ask for technical help with deployments?

Hi @latinlens, I can give you more individual help if you book a debugging session on my calendar: Calendly - Replit Deployments Team

1 Like