Comments (9)
@abdelhai agrees to investigate into the issue. I am reopening it.
from space-docs.
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.
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.
@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.
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.
... 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.
... 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 theinit()
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 endThere 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.
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.
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)
- [solved] astro not installing with `yarn install` HOT 2
- javascript stuff (ignore for a minute) HOT 2
- Migration guide has an incorrect example HOT 3
- Discord link expired HOT 1
- Switch to Content Collections HOT 2
- Rust App build time error: cargo: command not found HOT 2
- Doc says deta is installed on Micro. It is, but it's outdated. HOT 1
- After installing on Linux, start a new shell HOT 3
- FIX ERRORS
- ! Error: failed to create a project, developer mode needs to be enabled to build apps
- New User Docs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from space-docs.