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

Make serve recipe is failing #1092

Closed
gabisurita opened this issue Feb 17, 2017 · 4 comments
Closed

Make serve recipe is failing #1092

gabisurita opened this issue Feb 17, 2017 · 4 comments
Labels

Comments

@gabisurita
Copy link
Member

Seems related to #1087

gsurita-30820:kinto gsurita$ make serve 
.venv/bin/kinto --ini config/kinto.ini init
Select the backend you would like to use: (1 - postgresql, 2 - redis, default - memory) 
INFO   Created config /Users/gsurita/kinto/config/kinto.ini
.venv/bin/kinto --ini config/kinto.ini migrate
/Users/gsurita/kinto/kinto/core/initialization.py:567: UserWarning: HTTPS is not enabled
  warnings.warn('HTTPS is not enabled')
INFO   Running kinto 6.0.0.dev0. 
echo '{"name":"kinto","version":"5.3.1-118-g5fc2dedf","source":"https://github.com/gabisurita/kinto/","commit":"5fc2dedfc0a75d9f337ccdbcc935fa051f377164"}' > version.json
.venv/bin/kinto --ini config/kinto.ini start --reload
usage: kinto [-h] [-n NAME] [-s SERVER_TYPE] [--server-name SECTION_NAME]
             [--reload] [--reload-interval RELOAD_INTERVAL] [-b] [-v] [-q]
             [config_uri] [config_vars [config_vars ...]]
kinto: error: unrecognized arguments: http_port=8888
make: *** [serve] Error 2
@gabisurita
Copy link
Member Author

@gabisurita gabisurita added the bug label Feb 17, 2017
@glasserc
Copy link
Contributor

It seems like pserve had a massive rewrite upstream which breaks us in a couple of ways.

  • It seems like moving from optparse to argparse (Scripts optparse to argparse Pylons/pyramid#2864) changed the semantics of an argument string like ['pserve', 'config.ini', '--reload', 'http_port=8080']. For some reason, the argument parser fails to parse this, but it will parse correctly if --reload comes either before the INI file or after the variable.

  • It seems like the implementation of pserve used to re-invoke the same command as sys.argv, but now specifically recursively invokes pserve from inside a "monitored" reloader process. The second (inner) execution then tries to parse kinto serve arguments with pserve and totally fails.

It seems like we'll have to rewrite our kinto serve code to make it work with Pyramid 1.8. Since master is kind of broken right now, I think we should revert the change until someone has time to do that. In the meantime, @gabisurita points out that if you remove --reload from the Makefile, then everything works OK (but without reloading). We could make that change instead and create an issue to track it.

@Natim
Copy link
Member

Natim commented Feb 20, 2017

After investigation, it seems that --reload call hupper which takes sys.argv instead of the previous argv.

@Natim
Copy link
Member

Natim commented Feb 20, 2017

I made a pull-request upstream that should handle the matter: https://github.com/Pylons/pyramid/pull/2962/files

glasserc added a commit to Kinto/kinto-attachment that referenced this issue Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants