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

I literally can't even... #1867

Closed
InAnimaTe opened this Issue Dec 17, 2015 · 11 comments

Comments

Projects
None yet
5 participants
@InAnimaTe
Contributor

InAnimaTe commented Dec 17, 2015

I've been trying since Monday to actually stand up RTD and manually add a project. It never works...ever.

  1. I've tried pretty much ever docker image out there. None of them actually work.
  2. I've built my own docker image here.
  3. I've tried installing vanilla, in a venv, on trusty, in an arch container.
  4. The UI works. I can make an account, login, and get all the way to adding a Project. But the project never ever builds. On the build status page, I just see a spinning icon continuously.

A few further details:

  • rtd-build dir never gets created.
  • manifest.json and translations are created (in user_builds/<project_name>)
  • This happens whether or not I run it with gunicorn or manage.py
  • I can't (maybe I'm stupid) get manage.py to print out anything more than below. No debug or anything. I tried setting LOG_DEBUG to True, used -v 3 on manage.py, and still get basic INFO logs even from logs/rtd.log

Here's basically all I see when creating a project:

[16/Dec/2015 22:12:32] INFO [readthedocs.projects.tasks:815] (Build) [mongo:] Updating static me
tadata                                                                                          
[16/Dec/2015 22:12:32] INFO [readthedocs.core.utils:24] Running mkdir -p /readthedocs.org/user_b
uilds/mongo/translations on app servers                                                         
[16/Dec/2015 22:12:32] INFO [readthedocs.core.utils:24] Running ln -nsf /readthedocs.org/user_bu
ilds/mongo/rtd-builds /readthedocs.org/user_builds/mongo/translations/en on app servers         
[16/Dec/2015 22:12:32] INFO [readthedocs.core.utils:24] Running rm -f /readthedocs.org/user_buil
ds/mongo/single_version on app servers                                                          
[16/Dec/2015 22:12:32] INFO [readthedocs.projects.tasks:815] (Build) [mongo:] Updating static me
tadata                                                                                          
[16/Dec/2015 22:12:32]"GET /api/v1/project/1/ HTTP/1.1" 200 1314                                
[16/Dec/2015 22:12:32]"GET /api/v1/version/1/ HTTP/1.1" 200 1574                                
[16/Dec/2015 22:12:32]"GET /api/v2/build/1/ HTTP/1.1" 403 38                                    
[16/Dec/2015 22:12:32]"POST /dashboard/import/manual/ HTTP/1.1" 302 0                           
[16/Dec/2015 22:12:32]"GET /projects/mongo/ HTTP/1.1" 200 11838                                 
[16/Dec/2015 22:12:32]"GET /media/css/core.css HTTP/1.1" 200 39284                              
[16/Dec/2015 22:12:32]"GET /media/javascript/instantsearch.js HTTP/1.1" 200 5595                
[16/Dec/2015 22:12:32]"GET /media/javascript/base.js HTTP/1.1" 200 3337                         
[16/Dec/2015 22:12:32]"GET /projects/mongo/badge/?version=latest HTTP/1.1" 302 0                
[16/Dec/2015 22:12:32]"GET /media/images/project-bar-bg.png HTTP/1.1" 200 42376                 
[16/Dec/2015 22:12:32]"GET /media/images/body-bg.svg HTTP/1.1" 200 411                          
[16/Dec/2015 22:12:32]"GET /media/images/header-bg.png HTTP/1.1" 200 13624                      
[16/Dec/2015 22:12:32]"GET /media/images/logo.png HTTP/1.1" 200 4448                            
[16/Dec/2015 22:12:32]"GET /media/images/gradient-light.png HTTP/1.1" 200 216                   
[16/Dec/2015 22:12:32]"GET /media/images/gradient.png HTTP/1.1" 200 151                         
[16/Dec/2015 22:12:32]"GET /media/images/gear.png HTTP/1.1" 200 1899                            
[16/Dec/2015 22:13:05] INFO [readthedocs.core.views:483] Serving index.html for mongo           
[16/Dec/2015 22:13:05]"GET /docs/mongo/en/latest/ HTTP/1.1" 404 1811                            

And here's pretty much all that enters the log.

┌[root@box] [master] 
└[~/rtd/readthedocs.org]> cat logs/rtd.log 
[16/Dec/2015 22:52:06] INFO [readthedocs.projects.tasks:815] (Build) [kkk:] Updating static metadata 
[16/Dec/2015 22:52:06] INFO [readthedocs.core.utils:24] Running mkdir -p /home/mloria/rtd/readthedocs.org/user_builds/kkk/translations on app servers 
[16/Dec/2015 22:52:06] INFO [readthedocs.core.utils:24] Running ln -nsf /home/mloria/rtd/readthedocs.org/user_builds/kkk/rtd-builds /home/mloria/rtd/readthedocs.org/user_builds/kkk/translations/en on app servers 
[16/Dec/2015 22:52:06] INFO [readthedocs.core.utils:24] Running rm -f /home/mloria/rtd/readthedocs.org/user_builds/kkk/single_version on app servers 
[16/Dec/2015 22:52:06] INFO [readthedocs.projects.tasks:815] (Build) [kkk:] Updating static metadata 

I just don't know. A few of the docker images I've tried get to a printout from urllib3 saying "Starting connection".

If anyone has any insight at all, it would be much appreciated.

@agjohnson

This comment has been minimized.

Show comment
Hide comment
@agjohnson

agjohnson Dec 21, 2015

Contributor

Perhaps your images don't start build queues?

We don't support any of the docker images, so you're better off raising issues with those maintainers. Marking this community support as this isn't something the core team can devote time to.

Contributor

agjohnson commented Dec 21, 2015

Perhaps your images don't start build queues?

We don't support any of the docker images, so you're better off raising issues with those maintainers. Marking this community support as this isn't something the core team can devote time to.

@shidarin

This comment has been minimized.

Show comment
Hide comment
@shidarin

shidarin Feb 12, 2016

Did you load the test data? For my local builds, this happened when I hadn't created the SLUMBER API user. Even when I created a user to match the user specified in the settings, it still didn't work.. I had to load the test_data.

shidarin commented Feb 12, 2016

Did you load the test data? For my local builds, this happened when I hadn't created the SLUMBER API user. Even when I created a user to match the user specified in the settings, it still didn't work.. I had to load the test_data.

@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Feb 25, 2016

Contributor

Yeah actually looking at this again and made an entirely fresh ubuntu vm. Ran through all the steps on this doc page and builds still don't work. Exact same "nothing happens" result. I tried loading and not loading data.

Contributor

InAnimaTe commented Feb 25, 2016

Yeah actually looking at this again and made an entirely fresh ubuntu vm. Ran through all the steps on this doc page and builds still don't work. Exact same "nothing happens" result. I tried loading and not loading data.

@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Feb 25, 2016

Contributor

So, just seemed to figure this out. Maybe someone can explain this further.

Basically, the installation instructions literally only assume you're launching the server on purely localhost, and not on a remote server, in a docker container, or otherwise. Literally the basic default is that you're launching it on your current local system. If you're not, everything seems to work (ui, login, etc..) except for building. Why that is, I have no clue.

If some core team input could weigh in here. From my point of view, the documentation needs an overhaul in this area. Additionally, there are two sections on installing (the main one and another related to a VM) which should be collapsed into one section that describes changes necessary dependent on the hosting location, or at least, how to modify settings so things work as expected from the get-go.

I'm re-visiting containerizing this. Basically, I'm going to run rtd on its own in a container and reverse proxy that with an nginx container. While linked, hopefully this should still work as expected. I'll be taking a gander at the nginx section of the docs as well.

For now, I want to leave this open. I'll document my experiences and we can maybe discuss changes to the docs. No one should ever have to go through the pain and frustration I've had to.

Contributor

InAnimaTe commented Feb 25, 2016

So, just seemed to figure this out. Maybe someone can explain this further.

Basically, the installation instructions literally only assume you're launching the server on purely localhost, and not on a remote server, in a docker container, or otherwise. Literally the basic default is that you're launching it on your current local system. If you're not, everything seems to work (ui, login, etc..) except for building. Why that is, I have no clue.

If some core team input could weigh in here. From my point of view, the documentation needs an overhaul in this area. Additionally, there are two sections on installing (the main one and another related to a VM) which should be collapsed into one section that describes changes necessary dependent on the hosting location, or at least, how to modify settings so things work as expected from the get-go.

I'm re-visiting containerizing this. Basically, I'm going to run rtd on its own in a container and reverse proxy that with an nginx container. While linked, hopefully this should still work as expected. I'll be taking a gander at the nginx section of the docs as well.

For now, I want to leave this open. I'll document my experiences and we can maybe discuss changes to the docs. No one should ever have to go through the pain and frustration I've had to.

@HarryRybacki

This comment has been minimized.

Show comment
Hide comment
@HarryRybacki

HarryRybacki Feb 26, 2016

@InAnimaTe I'd run into the same problem a week ago. Didn't find anyone else complaining online and #readthedocs was silent so I thought I was crazy. Looking forward to your followup.

HarryRybacki commented Feb 26, 2016

@InAnimaTe I'd run into the same problem a week ago. Didn't find anyone else complaining online and #readthedocs was silent so I thought I was crazy. Looking forward to your followup.

@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Feb 26, 2016

Contributor

So let me give a breakdown:

  1. After some digging, we found that the port you're serving on (i.e. runserver 0.0.0.0:80) must be the same as the port defined for PRODUCTION_DOMAIN. This means that if you reverse proxy and serve on 1881, you would need to runserver 0.0.0.0:1881 and PRODUCTION_DOMAIN=example.net:1881.

  2. With that, we decided to utilize nginx as a reverse proxy. This still requires that you change the production_domain (or else everything on the site shows up as localhost) but for us, keeping the port included saw everything still working fine:

    PRODUCTION_DOMAIN=rtd.domain.com:80
    
  3. Then of course, with builds now working, the actual build pages had no design elements...turns out static assets weren't being copied over correctly. This is because #1967

We did this all with docker. You view my repository here.

You'll notice my local_settings.py where I define a few other niceties like disabling email verification and allowing private repos. I also install openssh-client so I can later on, internally, add in my private key for getting to private repos.

So here is an example docker-compose.yml for launching rtd:

rtd:
    build: .
    volumes:
        - ./db:/persistent
    environment:
        - "TEST_DATA=yes"
        - "RTD_PRODUCTION_DOMAIN=rtd.example.io:80"
nginx:
    image: nginx:1.9
    ports:
        - "80"
    volumes:
        - ./default.conf:/etc/nginx/conf.d/default.conf
    links:
        - rtd
Contributor

InAnimaTe commented Feb 26, 2016

So let me give a breakdown:

  1. After some digging, we found that the port you're serving on (i.e. runserver 0.0.0.0:80) must be the same as the port defined for PRODUCTION_DOMAIN. This means that if you reverse proxy and serve on 1881, you would need to runserver 0.0.0.0:1881 and PRODUCTION_DOMAIN=example.net:1881.

  2. With that, we decided to utilize nginx as a reverse proxy. This still requires that you change the production_domain (or else everything on the site shows up as localhost) but for us, keeping the port included saw everything still working fine:

    PRODUCTION_DOMAIN=rtd.domain.com:80
    
  3. Then of course, with builds now working, the actual build pages had no design elements...turns out static assets weren't being copied over correctly. This is because #1967

We did this all with docker. You view my repository here.

You'll notice my local_settings.py where I define a few other niceties like disabling email verification and allowing private repos. I also install openssh-client so I can later on, internally, add in my private key for getting to private repos.

So here is an example docker-compose.yml for launching rtd:

rtd:
    build: .
    volumes:
        - ./db:/persistent
    environment:
        - "TEST_DATA=yes"
        - "RTD_PRODUCTION_DOMAIN=rtd.example.io:80"
nginx:
    image: nginx:1.9
    ports:
        - "80"
    volumes:
        - ./default.conf:/etc/nginx/conf.d/default.conf
    links:
        - rtd
@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Feb 26, 2016

Member

@InAnimaTe Great, a PR against the docs updating this information would be great. There's also this: http://docs.readthedocs.org/en/latest/custom_installs/local_rtd_vm.html

Member

ericholscher commented Feb 26, 2016

@InAnimaTe Great, a PR against the docs updating this information would be great. There's also this: http://docs.readthedocs.org/en/latest/custom_installs/local_rtd_vm.html

@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Feb 26, 2016

Contributor

Yep, I plan on submitting something soon. When I create that, I'll close
this ;)
On Feb 26, 2016 2:38 PM, "Eric Holscher" notifications@github.com wrote:

@InAnimaTe https://github.com/InAnimaTe Great, a PR against the docs
updating this information would be great. There's also this:
http://docs.readthedocs.org/en/latest/custom_installs/local_rtd_vm.html


Reply to this email directly or view it on GitHub
#1867 (comment)
.

Contributor

InAnimaTe commented Feb 26, 2016

Yep, I plan on submitting something soon. When I create that, I'll close
this ;)
On Feb 26, 2016 2:38 PM, "Eric Holscher" notifications@github.com wrote:

@InAnimaTe https://github.com/InAnimaTe Great, a PR against the docs
updating this information would be great. There's also this:
http://docs.readthedocs.org/en/latest/custom_installs/local_rtd_vm.html


Reply to this email directly or view it on GitHub
#1867 (comment)
.

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Feb 26, 2016

Member

Great to hear!

Member

ericholscher commented Feb 26, 2016

Great to hear!

@shidarin

This comment has been minimized.

Show comment
Hide comment
@shidarin

shidarin Feb 27, 2016

@InAnimaTe This mostly gels with the solutions I just went through for our companies RTD server, although I did not have to do anything with nginx at all.

I also ran into #1967, but solved it with symlinks rather than ./manage.py collectstatic :/

I'm getting some quick clearance to see if I can share the full steps we took to get a fully functional RTD going.

shidarin commented Feb 27, 2016

@InAnimaTe This mostly gels with the solutions I just went through for our companies RTD server, although I did not have to do anything with nginx at all.

I also ran into #1967, but solved it with symlinks rather than ./manage.py collectstatic :/

I'm getting some quick clearance to see if I can share the full steps we took to get a fully functional RTD going.

InAnimaTe added a commit to InAnimaTe/readthedocs.org that referenced this issue Feb 29, 2016

cleanup, add collectstatic, and blurb about builds
This commit aims to solve the problems encountered in issue #1867 revolving around frustrations with getting an on-premises server started and working.
@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Feb 29, 2016

Contributor

Done: #2026

I'm going to close this. @shidarin if you want to discuss this further, shoot me a message and I'd be happy to look at what your company did to get this working. There may be more we can add to the docs to make it clearer for sysadmins to get this up and running (especially those who have never worked with anything django)

Contributor

InAnimaTe commented Feb 29, 2016

Done: #2026

I'm going to close this. @shidarin if you want to discuss this further, shoot me a message and I'd be happy to look at what your company did to get this working. There may be more we can add to the docs to make it clearer for sysadmins to get this up and running (especially those who have never worked with anything django)

@InAnimaTe InAnimaTe closed this Feb 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment