Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Robyn on Windows #139

Closed
patchgamestudio opened this issue Dec 21, 2021 · 6 comments · Fixed by #261
Closed

Cannot run Robyn on Windows #139

patchgamestudio opened this issue Dec 21, 2021 · 6 comments · Fixed by #261
Assignees
Labels
bug Something isn't working high-priority

Comments

@patchgamestudio
Copy link
Contributor

Running Python 3.9.7 on Windows 10 (Version 20H2, Build 19042.1348) with Robyn 0.10.0

When trying to run the basic Hello World app, there is some sort of fatal error that prevents it from running. The final error in my terminal says PermissionError: [WinError 5] Access is denied.

Just to be sure, I also tried running it in an admin console, and got a slightly different error. This time, the error indicates that the parameters passed to _winapi.OpenProcess() are incorrect.

However, both instances I see a type error where it is trying to pickle builtins.SocketHeld.

error.txt
error_as_admin.txt

@sansyrox
Copy link
Member

Hey @patchgamestudio ,

Thank you for reporting the issue and sorry for the late revert. This looks like a major issue. I don't own a windows machine personally but I will try to get this running using a VM.

This will be hopefully fixed in the next release.

One more thing, can you try running this in a wsl?

@patchgamestudio
Copy link
Contributor Author

I've run it previously in the Ubuntu 20.04 LTS WSL, and it didn't throw any errors. That's a solid work-around for any developers that can install that on their machine.

@sansyrox
Copy link
Member

@patchgamestudio , this should be fixed with the latest release. Can you please try one more time?

@patchgamestudio
Copy link
Contributor Author

I upgraded my test project to use robyn==0.12.0 and I am still unable to run the project. It looks like there's a new error:
OSError: The requested address is not valid in its context. (os error 10049)

Again, I tried running both as a regular user, as well as with admin rights, but both came back with that error.

Looking at the robyn package, it looks like the default url is 128.0.0.1, which seems unusual. I would have expected 127.0.0.1 or 0.0.0.0 to indicate the localhost IP.

@patchgamestudio
Copy link
Contributor Author

Digging more into this bug, it looks like there's an issue when trying to pass copied_socket to multiprocess.Process() in __init__.py:Robyn.start(). I'm seeing a lot of errors from pickle, the last one being:
TypeError: cannot pickle 'builtins.SocketHeld' object

I suspect that it's having trouble passing the socket to new processes because of how pickling objects works. I started searching online for a solution, and found a StackOverflow post that I assume you made a few months ago, considering large chunks of the code snippets match this repo exactly, and the usernames are similar. They pointed out that pickles are done in userspace and sockets exist in kernel space, which would explain the problem

According to this post, you might be able to use multiprocessing.Queue to assist in passing the socket, assuming >=Python3.4

@sansyrox
Copy link
Member

According to this post, you might be able to use multiprocessing.Queue to assist in passing the socket, assuming >=Python3.4

Thank you @patchgamestudio for this. I just read the accepted answer here and it does have a lot of potential. I will try implementing it in the code tomorrow. Thanks :D

@sansyrox sansyrox self-assigned this Feb 15, 2022
@sansyrox sansyrox added bug Something isn't working high-priority labels Feb 15, 2022
@sansyrox sansyrox mentioned this issue Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants