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

Validate conf.py before build docs #4745

Closed
humitos opened this issue Oct 10, 2018 · 9 comments
Closed

Validate conf.py before build docs #4745

humitos opened this issue Oct 10, 2018 · 9 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@humitos
Copy link
Member

humitos commented Oct 10, 2018

This build https://readthedocs.org/projects/wagtail/builds/7918857/ produced a log into Sentry as an ERROR https://sentry.io/read-the-docs/readthedocs-org/issues/712546002/?query=is:unresolved which is annoying. These exceptions are raised to communicate a specific message to the user and shouldn't be logged as ERROR for us to take a look at.

I'm not sure if this is already implemented in v2 of our configuration or not.

There is some related work at #4495 and #4590.

@humitos humitos added the Improvement Minor improvement to code label Oct 10, 2018
@humitos humitos added this to the Build error reporting milestone Oct 10, 2018
@stsewd
Copy link
Member

stsewd commented Oct 10, 2018

I think this happens when we try to find aconf.py file for the user and we found more than one. With v2 we still keep the find automatically magic.

@ba11b0y
Copy link
Contributor

ba11b0y commented Oct 17, 2018

@stsewd So is this supposed to be fixed? If yes, I would like to take a stab at it.

@stsewd
Copy link
Member

stsewd commented Oct 17, 2018

@invinciblycool we can't validate this on the config module because we put None when rtd needs to find the file automatically, I think there is a case where rtd fails to find one or there are multiple config files, we need to dig a little more to see the entire flow and see how we want to fix this.

@stale
Copy link

stale bot commented Jan 10, 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. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@stsewd stsewd added Accepted Accepted issue on our roadmap and removed Status: stale Issue will be considered inactive soon labels Jan 10, 2019
@stsewd
Copy link
Member

stsewd commented Mar 7, 2019

We haven't seen this in ~2 months, we should test if this can be replicated. I think it was raised when the project has 2 conf.py files, and isn't using a config file.

@stsewd
Copy link
Member

stsewd commented Mar 8, 2019

I was able to replicate this locally

Traceback (most recent call last):
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/doc_builder/backends/sphinx.py", line 176, in append_conf
    self.config_file or self.project.conf_file(self.version.slug)
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/projects/models.py", line 719, in conf_file
    ProjectConfigurationError.MULTIPLE_CONF_FILES,
readthedocs.projects.exceptions.ProjectConfigurationError: We found more than one conf.py and are not sure which one to use. Please, specify the correct file under the Advanced settings tab
 in the project's Admin.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/projects/tasks.py", line 565, in run_build
    outcomes = self.build_docs()
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/projects/tasks.py", line 830, in build_docs
    outcomes['html'] = self.build_docs_html()
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/projects/tasks.py", line 847, in build_docs_html
    html_builder.append_conf()
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/doc_builder/backends/sphinx.py", line 183, in append_conf
    ).with_traceback(trace)
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/doc_builder/backends/sphinx.py", line 176, in append_conf
    self.config_file or self.project.conf_file(self.version.slug)
  File "/home/stsewd/rtd/readthedocs.org/readthedocs/projects/models.py", line 719, in conf_file
    ProjectConfigurationError.MULTIPLE_CONF_FILES,
readthedocs.projects.exceptions.ProjectConfigurationError: A configuration file was not found. Make sure you have a conf.py file in your repository.

with this structure

├── conf.py
├── more
│   └── conf.py
├── README.rst
└── requirements.txt

stsewd added a commit to stsewd/readthedocs.org that referenced this issue Mar 8, 2019
We were hiding the real error
from the user

Related readthedocs#4745 (comment)
@dojutsu-user
Copy link
Member

@stsewd
Is this still valid?

@stsewd
Copy link
Member

stsewd commented Apr 16, 2019

Yeah, I think we fail with a general exception with the above structure #4745 (comment)

@dojutsu-user
Copy link
Member

@stsewd
I am not sure as what needs to be done here.
Can you provide some details here.

@readthedocs readthedocs deleted a comment Apr 18, 2019
@humitos humitos closed this as completed May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

4 participants