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

Error with Multiple workers on Windows #1517

Closed
MangoTobi opened this issue Mar 16, 2019 · 5 comments
Closed

Error with Multiple workers on Windows #1517

MangoTobi opened this issue Mar 16, 2019 · 5 comments

Comments

@MangoTobi
Copy link

We build a project with Sanic and vue.js on Windows. When we try to run the app with more than 1 worker we have the following error:

AttributeError: Can’t pickle local object ‘register.._handler’

However, when we comment the following line out, sanic starts with multiple workers but of course doesn’t serve the static files:

app.static(‘static’, ‘…/…/dist/static’)

Isn’t sanic able to run with multiple workers and serve static files on Windows? We tried it on Mac where it works.

main.py:

app = Sanic()
app.static('/static', './dist/static')
@app.route('/')
async def index(request):
    template = open(os.getcwd() + '/dist/index.html')
    return html(template.read())

run.py

if __name__ ==  "__main__":
    app.run(host='0.0.0.0', port=5000, workers=2)

Environment
windows 10
python 3.6.6
Vue: 3.5.0

@sjsadowski
Copy link
Contributor

Windows support is "experimental" and on a best-effort basis; I'm going to leave this open for now but it may ultimately get closed as windows isn't a primary testing target for us, so we can't guarantee everything works.

@sjsadowski sjsadowski changed the title Error with Multiple workers with static files on Windows Error with Multiple workers on Windows Apr 4, 2019
@TheMushrr00m
Copy link

FYI an alternative for windows is testing within the Windows Subsystem for Linux (WSL), this environment works very well for me when i need to use Windows in my work.

@enf644
Copy link

enf644 commented Jul 19, 2019

I encountered the same error on Windows 10. Cant use more than one worker. I get the same error but on all routes, not just static ones.

@stale
Copy link

stale bot commented Oct 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

@stale stale bot added the stale label Oct 17, 2019
@stale stale bot closed this as completed Nov 16, 2019
@HamsterHuey
Copy link
Contributor

HamsterHuey commented Jan 31, 2020

I don't see the point of having stale bot just auto close issues. A dupe of this issue was already closed in favor of this one and this finally just got auto closed. Are people supposed to continuously open new issues for the same thing that gets auto-closed? It would at the very least be nice to have a "wont-fix" label or some acknowledgement before letting issues be auto-closed so users can move on if this doesn't suit their needs.

HamsterHuey added a commit to HamsterHuey/sanic that referenced this issue Jan 31, 2020
As mentioned in sanic-org#1517 , Windows support is "experimental" and does not currently support multiple workers.
sjsadowski pushed a commit that referenced this issue Feb 3, 2020
As mentioned in #1517 , Windows support is "experimental" and does not currently support multiple workers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants