Code Monkey home page Code Monkey logo

Comments (9)

kumkee avatar kumkee commented on July 20, 2024 1

@abdelhai agrees to investigate into the issue. I am reopening it.

from space-docs.

mikBighne98 avatar mikBighne98 commented on July 20, 2024

Hey @kumkee, sorry for the delay in response. I see that you are trying to use custom run commands for your Python app on Space.
As said here, as of now the Python runtime on Space does not support custom run commands, but we are working on adding this feature in the near future. In the meantime, your app must be an instance of ASGI or WSGI (like FastAPI or Flask) with the app instance named app, when running on the Python runtime. Take a look at this for reference.

from space-docs.

mikBighne98 avatar mikBighne98 commented on July 20, 2024

Creating a new event loop and setting it as the current event loop seems to have solved the problem:

import asyncio
# rest of the code
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

Please try this and let us know if this resolves your issue :)

from space-docs.

kumkee avatar kumkee commented on July 20, 2024

@mikBighne98, thank you.

as of now the Python runtime on Space does not support custom run commands

I didn't intent to run commands under the python3.9 engine. It was an experiment with the SuperTokens team in an attempt to solve my problem.

The default branch has now been rolled back to the state without those custom commands or run sections.

Creating a new event loop and setting it as the current event loop seems to have solved the problem:

The suggested code is added under the asynico branch.

Both cases still give me errors:

Error Type:
Runtime.ExitError

Error Message:
RequestId: b1a5c903-8fde-4a3a-921a-7079ee1985ed Error: Runtime exited with error: exit status 127

Logs:
time="2023-03-15T18:26:19Z" level=info msg="serving logs listener on sandbox.localdomain:1234" agent=logsApiAgent
TELEMETRY	Name: telemetry-extension	State: Subscribed	Types: [Function]
/opt/bootstrap: does not exist

The live app is with the asyncio branch at the moment.

from space-docs.

mikBighne98 avatar mikBighne98 commented on July 20, 2024

I just redeployed using the exact same source code of backend under the asyncio branch. Just commented this and replaced the API keys and client secret with random strings as I don't have those. And it successfully deployed and returned {"message":"Hello World"} when I accessed the endpoint. I don't see anything wrong in your Spacefile also. Make sure you're deploying the source code from the right branch and if it still persists try to change the micro name maybe. But do let us know :)

from space-docs.

kumkee avatar kumkee commented on July 20, 2024

... replaced the API keys and client secret with random strings as I don't have those. And it successfully deployed and returned {"message":"Hello World"} ...

With random keys, python would ignore the init(...) part I guess, which has been the cause of the problem.
Let me publicise (or share with you) the secret file later today (I'm going away from my PC).
With successfully running the init() part, you would be able to access the /auth/dashboard path of the endpoint as well.

from space-docs.

kumkee avatar kumkee commented on July 20, 2024

... replaced the API keys and client secret with random strings as I don't have those. And it successfully deployed and returned {"message":"Hello World"} ...

With random keys, python would ignore the init(...) part I guess, which has been the cause of the problem. Let me publicise (or share with you) the secret file later today (I'm going away from my PC). With successfully running the init() part, you would be able to access the /auth/dashboard path of the endpoint as well.

@mikBighne98 The secret keys are now published.
Very weirdly, I can no longer push to the project. space-cli says Error: failed to push code, unauthorized. Is it because you are using it as well?

update: creating a new space project solved both the "unauthorized" and uvicorn problems.

Now it works! https://stks-1-n8187335.deta.app/auth/dashboard

Unless you want to find out why the old space-project corrupts, we can close the issue! - by the way, is there a way to delete a space-projet?

Summary:

  • Error: Runtime exited with error: exit status 127 indicates the possibility of corruption on the cloud end
  • There is no current event loop in thread 'MainThread'. error can be solved with the following
import asyncio
# rest of the code
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

from space-docs.

kumkee avatar kumkee commented on July 20, 2024

Unless you want to find out why the old space-project corrupts, ...

I guess this is worth opening another issue but doesn't concern me as a user. All I hope is that you consider adding these to your future version of your documentation as well. I am closing the issue now.

Thank you @mikBighne98, @abdelhai and the rest of the Deta team. Although it is in beta with some problems, your support makes my experience with Deta Space more enjoyable.

from space-docs.

mikBighne98 avatar mikBighne98 commented on July 20, 2024

Thanks a lot for your kind words, @kumkee. We are actively working on fixing these issues and improving the deployment process.

Unless you want to find out why the old space-project corrupts

We have received several reports regarding this. We are investigating the cause and will try to resolve it as soon as possible.

By the way, is there a way to delete a space-project?

As of now, there is no way to delete a project, but we plan to add this feature in the near future.

from space-docs.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.