You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fetch_20newsgroups failed. HTTP Error 500: Internal Server Error #3841
>>> from sklearn.datasets import fetch_20newsgroups
>>> categories = ['alt.atheism', 'soc.religion.christian',
... 'comp.graphics', 'sci.med']
>>> twenty_train = fetch_20newsgroups(subset='train',categories=categories, shuffle=True, random_state=42)
No handlers could be found for logger "sklearn.datasets.twenty_newsgroups"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sklearn/datasets/twenty_newsgroups.py", line 221, in fetch_20newsgroups
cache_path=cache_path)
File "/Library/Python/2.7/site-packages/sklearn/datasets/twenty_newsgroups.py", line 92, in download_20newsgroups
opener = urlopen(URL)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error
I think that the remark of @ogrisel is general and easy to implement. However, if you are interested in the nilearn dataset downloader, here are the features:
retry automatically a second time if a download fail
download files by batch, in a sandbox, and clean everything in case of error
support resuming of dataset download (useful for big ones)
easy to use archive extraction / file renaming / md5 hash checking
I must say that during my tests, I never encountered the problem evoked here (ie a file downloadable using a browser but not using urlopen).
@ogrisel, @amueller, would it be worth "owning" the storage location for tutorials and test data? I have also noticed some slow downloads that can delay testing.
I would be happy to donate an S3 bucket to store all requisite data.
Interesting idea. On the one hand, it would be nice to have control, on the other hand it kind of means additional maintenance burden.... I'm a bit torn. Don't you have to pay for S3 per download? I think we skip them in travis, but if the skipping failed, that could give a serious hit ;)
Can you create a PR that replaces the links in the datasets folder with links to your buckets? I'd be 👍 on that, but it would be a good way to get feedback. It would definitely be faster, but we need to be able to rely on them being their for the next couple of years ;)
@amueller, my bucket offer is still on the table. I'd be happy to share creds with you or another maintainer outside of the repo to keep it up-to-date.
Activity
larsmans commentedon Nov 17, 2014
Works fine here. Could you try again? Might be a fluke over at MIT.
ogrisel commentedon Nov 21, 2014
It might be worth implementing a retry mechanism in the dataset downloaders. I think nilearn has one.
GaelVaroquaux commentedon Nov 21, 2014
It has a partial download mechanism, with resume. @AlexandreAbraham
is the one who implemented it. He is back in Paris in 2 weeks.
AlexandreAbraham commentedon Nov 21, 2014
I think that the remark of @ogrisel is general and easy to implement. However, if you are interested in the nilearn dataset downloader, here are the features:
I must say that during my tests, I never encountered the problem evoked here (ie a file downloadable using a browser but not using urlopen).
mjbommar commentedon Mar 6, 2015
@ogrisel, @amueller, would it be worth "owning" the storage location for tutorials and test data? I have also noticed some slow downloads that can delay testing.
I would be happy to donate an S3 bucket to store all requisite data.
amueller commentedon Mar 6, 2015
Interesting idea. On the one hand, it would be nice to have control, on the other hand it kind of means additional maintenance burden.... I'm a bit torn. Don't you have to pay for S3 per download? I think we skip them in travis, but if the skipping failed, that could give a serious hit ;)
mjbommar commentedon Mar 7, 2015
Would be happy to give it a try :) Easy enough to do the math on cost per download once we know how many files there are.
Got any suggestion on identifying all the external resources?
mjbommar commentedon Mar 7, 2015
Seems like there's only ~35MB in ~/scikit_learn_data. If we had 5000 requests/month, it'd still only be ~$10/mo. Happy to handle that.
I've put them up here for now and made all objects in the bucket public:
amueller commentedon Mar 9, 2015
Can you create a PR that replaces the links in the datasets folder with links to your buckets? I'd be 👍 on that, but it would be a good way to get feedback. It would definitely be faster, but we need to be able to rely on them being their for the next couple of years ;)
mcculloh commentedon Nov 16, 2015
The mit url: curl -v 'http://people.csail.mit.edu/jrennie/20Newsgroups/'
redirects to
http://qwone.com/~jason/20Newsgroups
But the http response is a 200 and not a redirect. Could be that the mit.edu page is just flakey
amueller commentedon Dec 11, 2015
@mcculloh you think that is related to the server error? Maybe not going via the redirect would be more stable, so only one server can fail ^^
mjbommar commentedon Jan 4, 2016
@amueller, my bucket offer is still on the table. I'd be happy to share creds with you or another maintainer outside of the repo to keep it up-to-date.
amueller commentedon Sep 14, 2016
we could actually use figshare, I think!
GaelVaroquaux commentedon Sep 14, 2016
lesteve commentedon Sep 25, 2017
Closing we are using figshare now.