Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Twisted v17.1.0 fails on port string #26

Closed
robgjansen opened this issue Mar 15, 2017 · 8 comments
Closed

Twisted v17.1.0 fails on port string #26

robgjansen opened this issue Mar 15, 2017 · 8 comments

Comments

@robgjansen
Copy link
Owner

OnionPerf gives a warning when using twisted 17.1.0 that is not present on twisted 16.6.0:

[onionperf] [WARNING] command '/usr/local/bin/twistd -n -l - web --port
8090 --path /home/cloud/onionperf/onionperf-data/twistd/docroot
--mime-type=None' finished before expected

And the twisted log file onionperf-data/twistd/onionperf.twisted.log:

   app.run(runApp, ServerOptions)
 File
"/usr/local/lib/python2.7/dist-packages/twisted/application/app.py",
line 662, in run
   runApp(config)
 File
"/usr/local/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line
25, in runApp
   _SomeApplicationRunner(config).run()
 File
"/usr/local/lib/python2.7/dist-packages/twisted/application/app.py",
line 380, in run
   self.application = self.createOrGetApplication()
 File
"/usr/local/lib/python2.7/dist-packages/twisted/application/app.py",
line 440, in createOrGetApplication
   ser = plg.makeService(self.config.subOptions)
 File "/usr/local/lib/python2.7/dist-packages/twisted/web/tap.py", line
254, in makeService
   strports.service(config['port'], site).setServiceParent(s)
 File
"/usr/local/lib/python2.7/dist-packages/twisted/application/strports.py",
line 40, in service
   endpoints.serverFromString(reactor, description), factory)
 File
"/usr/local/lib/python2.7/dist-packages/twisted/internet/endpoints.py",
line 1569, in serverFromString
   nameOrPlugin, args, kw = _parseServer(description, None)
 File
"/usr/local/lib/python2.7/dist-packages/twisted/internet/endpoints.py",
line 1487, in _parseServer
   getPlugins(IStreamServerEndpointStringParser), endpointType
 File
"/usr/local/lib/python2.7/dist-packages/twisted/internet/endpoints.py",
line 1503, in _matchPluginToPrefix
   raise ValueError("Unknown endpoint type: '%s'" % (endpointType,))
ValueError: Unknown endpoint type: '8090'

Reported by @hiromipaw (thanks!)

@robgjansen robgjansen added the bug label Mar 15, 2017
@hiromipaw
Copy link

Hi Rob,
As suggested, I run the twistd daemon separately and discovered that in version 17.1.0 the option for port was dropped (https://linux.die.net/man/1/twistd). Maybe this is the problem?
Run:

$ /usr/local/bin/twistd -n -l - web  --path /onionperf/onionperf-data/twistd/docroot --port 8090 --mime-type=None
...
raise ValueError("Unknown endpoint type: '%s'" % (endpointType,))
ValueError: Unknown endpoint type: '8090'

@robgjansen
Copy link
Owner Author

Yes, you seem to be correct:
https://twistedmatrix.com/pipermail/twisted-python/2012-March/025362.html

Looks like we just need to find a work-around - I hope they have an alternative to that option.

@hadifarnoud
Copy link

did you find a workaround @robgjansen ? I'm using Sentry on Heroku. your solution doesn't work in Heroku

@robgjansen
Copy link
Owner Author

Well, I didn't recommend a solution, so I'm not surprised that it doesn't work (8-D) More seriously, though, we are planning on removing the twisted web server entirely from onionperf, so soon this issue will not affect us in this project.

@hiromipaw
Copy link

@hadifarnoud downgrading twisted version would work. It is a bit of a ugly hack though, I understand.

@jasco
Copy link

jasco commented Jun 7, 2017

@robgjansen try --port "tcp:port=8090"

lebolo added a commit to h3biomed/s3proxy that referenced this issue Jul 12, 2017
_twistd_ changed the way `--port` works in versions > 16.6.0

see robgjansen/onionperf#26 (comment) for details
@irl
Copy link
Contributor

irl commented Jan 10, 2019

This would be fixed by #45

@robgjansen
Copy link
Owner Author

robgjansen commented Jan 11, 2019

Invalid, now that we removed support for the twistd server in ad3f234.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants