deta / cloud-docs

old docs. visit space docs instead:
https://github.com/deta/space-docs
Creative Commons Attribution 4.0 International
178 stars 67 forks source link

Unknown Error while Deploying #148

Closed Hunter2809 closed 3 years ago

Hunter2809 commented 3 years ago

Hey!

I was checking out this website and trying to run my Flask API on it. I am running it on repl.it as of now, but your service fascinates me tbh. Anyways, well it was starting without any error(s) on repl.it and on my local laptop. But while deploying, I am getting this error again and again.

Running micro...

Response:
{
        "errorMessage": "'path'",
        "errorType": "KeyError",
        "stackTrace": [
                "  File \"/opt/python/detalib/debugger.py\", line 154, in wrap\n    raise e\n",
                "  File \"/opt/python/detalib/debugger.py\", line 142, in wrap\n    result = func(event, context)\n",
                "  File \"/var/task/_entry.py\", line 14, in handler\n    return handle(event, main)\n",
                "  File \"/opt/python/detalib/handler.py\", line 32, in handle\n    return handlers.handle_bare_wsgi(event, main, context)\n",
                "  File \"/opt/python/detalib/handlers.py\", line 32, in handle_bare_wsgi\n    return resolve(main.app, event)\n",
                "  File \"/opt/python/detalib/adapters/wsgi/__init__.py\", line 149, in resolve\n    result = app(get_environ(event), response.start_response)\n",
                "  File \"/opt/python/detalib/adapters/wsgi/__init__.py\", line 22, in get_environ\n    \"PATH_INFO\": event[\"path\"],\n"
        ]
}

I have listed both of my dependencies in the requirements.txt (python-aiml and flask) and, if this is important, I don't use deta library in my code. Help would be appreciated!

Thanks!

abdelhai commented 3 years ago

Hi @Hunter2807, please share your code for us to be able to help you. Feel free to reach out on Slack for faster support.

Hunter2809 commented 3 years ago

Hey there @abdelhai!

Thanks for the reply, but the code is quite big. What part do u want? The one, with which I make the Flask API? Actually I have a private AI API and it has some AI files and a JSON file to store some information. Could be something is wrong with the path of those?

Anyways, I cannot give u the whole code cz of privacy purposes too, but I can provide u the code where I make the Flask API. Will that be sufficient?

abdelhai commented 3 years ago

@Hunter2807 you seem to be using deta run, this command is not related to running your web app. Just visit your Micro URL. You can find it in your dashboard (web.deta.sh) or by running deta details locally inside your project's directory.

Hunter2809 commented 3 years ago

Ah, it works now. could be some cache problem that time... BTW, may I know what's the use of deta run then and why was I getting that error?

Hunter2809 commented 3 years ago

Ah, thanks. It works!

Also, do u know how can I access the linux VM for my website?

abdelhai commented 3 years ago

@Hunter2807 you were getting the error because you were entering the deta run command (no caching issues).

Deta Run is a completely different product that runs on Micros which helps you make web-based CLI apps. You needn't to learn it for Flask, etc.

Micros run automatically after you deploy the code.

Also, do u know how can I access the linux VM for my website?

No.