<div dir="ltr">Thank you Max.<div><br></div><div>It solved the issue.</div><div>gen</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 5, 2021 at 2:47 PM Max Romanov <<a href="mailto:max.romanov@nginx.com">max.romanov@nginx.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Most likely it’s a permission issue. Try to specify "user": "ec2-user" for your "demo" app in configuration.<br>
By default, application starts as "nobody" user and have no permissions to access files in other users’ directories.<br>
<br>
—<br>
Regards,<br>
Max<br>
<br>
> On 5 Jan 2021, at 16:37, Bot-Publishing Inc. <<a href="mailto:info@botpublishing.com" target="_blank">info@botpublishing.com</a>> wrote:<br>
> <br>
> Hello,<br>
> <br>
> I installed the latest Unit package for RHEL 8.<br>
> <br>
> When I try to configure a simple demo app, I am getting:<br>
> <br>
> 2021/01/05 13:27:07 [info] 13694#13694 "demo" application started<br>
> 2021/01/05 13:27:07 [alert] 13694#13694 Python failed to import module "temp" ModuleNotFoundError: No module named 'temp'<br>
> 2021/01/05 13:27:07 [notice] 13630#13630 process 13694 exited with code 1<br>
> 2021/01/05 13:27:07 [warn] 13633#13633 failed to start application "demo"<br>
> 2021/01/05 13:27:07 [alert] 13633#13633 failed to apply new conf<br>
> <br>
> The JSON config is as following<br>
> ============================================<br>
> {<br>
>   "listeners": {<br>
>       "*:8080": {<br>
>           "pass": "applications/demo"<br>
>       }<br>
>   },<br>
>   "applications": {<br>
>       "demo": {<br>
>           "type": "python",<br>
>           "path": "/home/ec2-user/bp_tts/tmp/",<br>
>           "module": "temp",<br>
>           "protocol": "wsgi"<br>
>       }<br>
>   }<br>
> }<br>
> <br>
> temp.py<br>
> ============================================<br>
> def application(environ, start_response):<br>
>     start_response("200 OK", [("Content-Type", "text/plain")])<br>
>     return (b"Hello, Python on Unit!")<br>
> <br>
> <br>
> PWD of temp.py<br>
> ============================================<br>
> /home/ec2-user/bp_tts/tmp<br>
> <br>
> Would appreciate any advice.<br>
> <br>
> Thank you,<br>
> gen<br>
> _______________________________________________<br>
> unit mailing list<br>
> <a href="mailto:unit@nginx.org" target="_blank">unit@nginx.org</a><br>
> <a href="https://mailman.nginx.org/mailman/listinfo/unit" rel="noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/unit</a><br>
<br>
_______________________________________________<br>
unit mailing list<br>
<a href="mailto:unit@nginx.org" target="_blank">unit@nginx.org</a><br>
<a href="https://mailman.nginx.org/mailman/listinfo/unit" rel="noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/unit</a></blockquote></div>