Skip to content

CNAME goes to wrong project and/or a 404 #3179

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
AlbertMietus opened this issue Oct 22, 2017 · 28 comments
Closed

CNAME goes to wrong project and/or a 404 #3179

AlbertMietus opened this issue Oct 22, 2017 · 28 comments
Labels
Accepted Accepted issue on our roadmap Bug A bug Good First Issue Good for new contributors

Comments

@AlbertMietus
Copy link

I would like to serve my 'MESS' project (http://mess.readthedocs.io/) from a own domain. So, I setup
CNAME support as described by: http://docs.readthedocs.io/en/latest/alternate_domains.html#cname-support

However, I doesn't work. Even after a log of variations and "debugging" (details below).

So, I assume it's a bug....

Effect & reproduce

Firstly, I assumed I made a mistake. And tries several variations -- no effect. And even created another new project; doing everything again; even with another domain (http://DocIdeas.mietus.nl/). Nothing improved. The latter link goes to the same "Chinese page"

Details

DIG

MESS.SoftwareBeterMaken.nl. 2900 IN CNAME readthedocs.io.

(Also see: https://toolbox.googleapps.com/apps/dig/#ANY/MESS.SoftwareBeterMaken.nl)

Setting

At RTfD: (project=MESS) Admin | Domains

MESS.SoftwareBeterMaken.nl

I tried this with and without trailing dot -- no effect

Bug or Mistake?

As (I assume) many people use this feature, I can't imagine it;s a bug. So, when it's my mistake, please help. Or maybe it's a real bug. Then please fix :-)

Note: As A suggestion, I would be nice to be able to retrieve "logging/debugging" info about this, So I/others can get feedback on why which page, or symlinks, or ... is (mis)used. Than I would be able to fix my mistake

Something like the views on the "BUILD/..." page would be nice
(like: https://readthedocs.org/projects/mess/builds/6158940/)

Thanks for RTfD, ReadTheDocs.org and the help

--Albert

@RichardLitt
Copy link
Member

As (I assume) many people use this feature, I can't imagine it;s a bug. So, when it's my mistake, please help. Or maybe it's a real bug. Then please fix :-)

If it's a mistake many people make, it's a problem if we don't have that in the documentation to help people out. Either way, we need to fix this workflow. :)

@AlbertMietus
Copy link
Author

WORKAROUND

Only use lowercase in de domain-field

This kind of solves it ....

It depend op capitals in the Admin ->Domain - > ... field
When CamelCaseWords are used in that field, it does NOT work.

  • I used MESS.SoftwareBeterMaken.nl-- for readability. It didn't work.
  • But a second, after I set it to mess.softwarebetermaken.nl it does work.

(still, it a bug: in code or docs)

Plz doc it. Or better: use .lowercase() before using the setting. Thanks

@RichardLitt RichardLitt added the Bug A bug label Nov 11, 2017
@ericholscher
Copy link
Member

Sounds like a good fix! https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/projects/forms.py#L546 would be a good place to implement it 🎆

@stsewd stsewd added the Good First Issue Good for new contributors label May 21, 2018
@dojutsu-user
Copy link
Member

dojutsu-user commented Sep 30, 2018

@stsewd I would like to work on this issue. Can you guide me as I am totally new here.

@stsewd
Copy link
Member

stsewd commented Oct 1, 2018

@dojutsu-user this should be fixed here https://github.com/rtfd/readthedocs.org/blob/2d9ca7df405a15c3e7e278c68c3fb9f98fe13d36/readthedocs/projects/forms.py#L646 I guess, but first, you should test that this behavior persists in the current version of rtd.

@dojutsu-user
Copy link
Member

dojutsu-user commented Oct 2, 2018

@stsewd I registered a free domain and added the CNAME records (according to the docs) and then added the Domain in the readthedocs.org Admin Panel in CamelCase.

screenshot from 2018-10-02 10-20-27

It is working, when I tried to go to http://DOCS.DojutsuUserHelloWorld.Tk , the docs opened without any error.
I think that the error is no more.

However, to prevent any issues in future, wouldn't it be better to store the domains in lowercase in the first place itself.

def clean_domain(self):
        parsed = urlparse(self.cleaned_data['domain'])
        if parsed.scheme or parsed.netloc:
            domain_string = parsed.netloc
        else:
            domain_string = parsed.path
        return domain_string.lower()

@stsewd
Copy link
Member

stsewd commented Oct 2, 2018

@dojutsu-user thanks for checking!

@AlbertMietus is this still a problem for you?

@stsewd stsewd added the Needed: more information A reply from issue author is required label Oct 2, 2018
@AlbertMietus
Copy link
Author

AlbertMietus commented Oct 2, 2018 via email

@AlbertMietus
Copy link
Author

It is working, when I tried to go to http://DOCS.DojutsuUserHelloWorld.Tk , the docs opened without any error.

@dojutsu-user: When I click that link, it does NOT work (anymore?).

I tested it on Safari (Mac & iOS), Firefox (Mac); all the same.
It did also try on Edge/Window; there I get a warning/error from the firewall: (blocked) site camouflages real nature bla bla. Possible that is related or not

@stsewd: I guess, it nor really fixed

Note: previous post ( by mobile/email) is maybe out-of-(time)-line

@stsewd
Copy link
Member

stsewd commented Oct 2, 2018

So, I can't enter to http://docs.mio-lang.org/ either http://DOCS.DojutsuUserHelloWorld.Tk, I'll test this with a domain I own later.

@dojutsu-user
Copy link
Member

@stsewd I have changed the domain from camel case to lowercase. And now it seems to be working with me. Please confirm it from your side also.
And the domain is registered for 12 months. So, I don't think that this error is because of the domain.

@stsewd
Copy link
Member

stsewd commented Oct 2, 2018

It works for me too! What was the exact domain that makes it fail?

@dojutsu-user
Copy link
Member

@stsewd exact domain was DOCS.DojutsuUserHelloWorld.Tk

@stsewd
Copy link
Member

stsewd commented Oct 2, 2018

Wasn't that the same that was working yesterday? :_

@dojutsu-user
Copy link
Member

@stsewd yes, this confusion might be from my side because CNAME records may take 2-3hrs to properly set up. And I tested it immediately. This might be the reason but I'm not sure about why it stopped working.

@dojutsu-user
Copy link
Member

@stsewd any update on this?

@nymd
Copy link

nymd commented Nov 25, 2018

This is still a bug @stsewd @dojutsu-user @AlbertMietus

Brand new project (sft-protocol.readthedocs.io)

Brand new domains (tried both sftprotocol.com and sft-protocol.com)

Using the "docs" subdomain, everything gets redirected the SAME project as the OP's issue.

;; ANSWER SECTION:
docs.sft-protocol.com. 300 IN CNAME readthedocs.io.

curl -v http://docs.sft-protocol.com/

  • Trying 104.18.228.122...

< HTTP/1.1 302 Found
< Location: http://docs.mio-lang.org/zh_CN/latest/

I've never used CamelCase or any sort of capitals anywhere in the project settings or DNS. I've had to change the DNS records now so that the domains redirect in another way so the current records won't reflect what I pasted above.

@ericholscher
Copy link
Member

Did you setup a Domain object in your project dashboard?

@ericholscher
Copy link
Member

ericholscher commented Nov 25, 2018

It looks like your DNS is not configured properly:

;; QUESTION SECTION:
;docs.sft-protocol.com.		IN	A

;; ANSWER SECTION:
docs.sft-protocol.com.	4	IN	A	52.217.1.27

@nymd
Copy link

nymd commented Nov 25, 2018

Thanks for the reploy @ericholscher

I did setup the domains in my Admin panel on RTD:

Existing Domains

sftprotocol.com (Edit) (Remove)
sft-protocol.com (Edit) (Remove)

I've since had to change the DNS so I can have the domain working and redirecting. Previous to this it was setup with the CNAME:

;; ANSWER SECTION:
docs.sft-protocol.com. 300 IN CNAME readthedocs.io.

@ericholscher
Copy link
Member

You have to setup the exact CNAME you want, so docs.sftprotocol.com (Edit) (Remove)

@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
@no-response
Copy link

no-response bot commented Jan 10, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thanks!

@no-response no-response bot closed this as completed Jan 10, 2019
@stsewd
Copy link
Member

stsewd commented Jan 10, 2019

Sorry for the bot, this is still valid.

@stsewd stsewd reopened this Jan 10, 2019
@stsewd stsewd added Accepted Accepted issue on our roadmap and removed Needed: more information A reply from issue author is required Status: stale Issue will be considered inactive soon labels Jan 10, 2019
@eviatarbach
Copy link

I am having this same problem, with a new project and the domain in lowercase. http://www.parasweep.io keeps resolving to http://docs.mio-lang.org/zh_CN/latest/.

@davidfischer
Copy link
Contributor

I am having this same problem, with a new project and the domain in lowercase. http://www.parasweep.io keeps resolving to http://docs.mio-lang.org/zh_CN/latest/.

Starting after the next deploy, you'll just get a 404. This changed in #5143.

The reason you're getting this is that you have not correctly setup your domain. Here's our documentation on the subject.
You have correctly set the CNAME record for www.parasweep.io to readthedocs.io, however, the Domain record you added to Read the Docs just says "parasweep.io" and not "www.parasweep.io". You should be able to change it here: https://readthedocs.org/dashboard/paraweep/domains/

@eviatarbach
Copy link

Thank you so much! That fixed it.

@ericholscher
Copy link
Member

This is now shipped 👍

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 Bug A bug Good First Issue Good for new contributors
Projects
None yet
Development

No branches or pull requests

8 participants