Skip to content

Build time out when hitting the api to get active versions #6304

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

Closed
ChoiByungWook opened this issue Oct 17, 2019 · 13 comments
Closed

Build time out when hitting the api to get active versions #6304

ChoiByungWook opened this issue Oct 17, 2019 · 13 comments
Labels
Bug A bug Status: blocked Issue is blocked on another issue

Comments

@ChoiByungWook
Copy link

ChoiByungWook commented Oct 17, 2019

Details:

Expected Result

Build succeed

Actual Result

Based on the build history, the builds have been failing and passing inconsistently.

The following things are inconsistent when looking at our build history:

  1. Build time (succeeds and failures ranging from 70s - 220s)
  2. Build log output (log outputs for failed builds are inconsistent)
  3. Error indication (A lot of the failed builds don't display any obvious error, as listed below.)

Can we get some insight into why the builds failed, specifically for these:

The peculiar thing is that this next build succeeded but it was a one line change in the code, with not much changes in the RST or documentation.

Corresponding changes for the build above:

@stsewd stsewd added the Support Support question label Oct 17, 2019
@laurenyu
Copy link

any update? we're continuing to see a lot of transient failures, especially when multiple builds in the same project are run simultaneously

@stsewd
Copy link
Member

stsewd commented Oct 25, 2019

It may be related to time outs, I'll increase the build time of the projects on monday

@laurenyu
Copy link

thanks for your help!

@laurenyu
Copy link

@stsewd were you able to increase the build time yesterday? the failures have become more consistent now, but the error message simply says "There was a problem with Read the Docs while building your documentation. Please try again later. However, if this problem persists, please report this to us with your build id"

@stsewd
Copy link
Member

stsewd commented Oct 29, 2019

Sorry, I wasn't able to get to this yesterday, I'm checking now.

@stsewd
Copy link
Member

stsewd commented Oct 29, 2019

Looking at this doesn't look like it's from timeout. Not sure what's causing it. I'm investigating a little more

@stsewd
Copy link
Member

stsewd commented Oct 30, 2019

I wasn't able to reproduce this locally, but I found this in the logs

readthedocs.doc_builder.environments:619[24217]: ERROR (Build) [sagemaker:stable] HTTPSConnectionPool(host='10.32.16.11', port=10443): Max retries exceeded with url: /api/v2/project/164476/active_versions/ (Caused by ResponseError('too many 502 error responses',))

@laurenyu
Copy link

hmm was there anything around that line that might suggest what could be causing the 502 response?

@stsewd
Copy link
Member

stsewd commented Oct 30, 2019

I'm investigating that. It's probably a slow query.

@stsewd
Copy link
Member

stsewd commented Oct 30, 2019

Looks like the slowness is because the amount of active versions your project has (149). I'm seeing the same on projects that have more than 100 active versions. This number of project with more than 100 active versions is really low, though. There are only 7 projects affected by this.

The explanation, we are hitting azure cloud storage to check if the epub, zip, pdf files exists

def has_media(self, type_, version_slug=LATEST, version_type=None):
path = self.get_production_media_path(
type_=type_, version_slug=version_slug
)
if os.path.exists(path):
return True
storage = get_storage_class(settings.RTD_BUILD_MEDIA_STORAGE)()
storage_path = self.get_storage_path(
type_=type_, version_slug=version_slug,
version_type=version_type
)
return storage.exists(storage_path)

The API returns that here
downloads = serializers.DictField(source='get_downloads', read_only=True)

(but we actually don't use that value for building)

Anyway, we are in the progress of a solution to avoid querying azure that much #6278

In the mean time, if you don't really need to keep all 149 versions active, you can disable them https://readthedocs.org/projects/sagemaker/versions/. Having less than 100 active versions should make the builds happy again.

@stsewd stsewd added Bug A bug Status: blocked Issue is blocked on another issue and removed Support Support question labels Oct 30, 2019
@stsewd stsewd changed the title Build error with build id #9817944 Build time out when hitting the api to get active versions Oct 30, 2019
@laurenyu
Copy link

Great, thanks for digging into this! I see #6278 has been merged - is there an ETA on when that will be released?

@stsewd
Copy link
Member

stsewd commented Oct 30, 2019

@laurenyu the above PR is just one part of what needs to be done to reduce the number of queries.

@stsewd
Copy link
Member

stsewd commented Dec 4, 2019

We now don't query azure anymore

def get_downloads(self, pretty=False):
project = self.project
data = {}
def prettify(k):
return k if pretty else k.lower()
if self.has_pdf:
data[prettify('PDF')] = project.get_production_media_url(
'pdf',
self.slug,
)
if self.has_htmlzip:
data[prettify('HTML')] = project.get_production_media_url(
'htmlzip',
self.slug,
)
if self.has_epub:
data[prettify('Epub')] = project.get_production_media_url(
'epub',
self.slug,
)
return data

@stsewd stsewd closed this as completed Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Status: blocked Issue is blocked on another issue
Projects
None yet
Development

No branches or pull requests

3 participants