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

SmartHTTP 401 Unauthorized #141

Open
sduensin opened this issue Jan 20, 2012 · 5 comments
Open

SmartHTTP 401 Unauthorized #141

sduensin opened this issue Jan 20, 2012 · 5 comments

Comments

@sduensin
Copy link

I'm sure this is something I've done wrong, but I can't figure it out. I performed a fresh Redmine 1.3.0 install on Ubuntu Server 11.10 with Apache 2 and Passenger.

My Apache configuration:

LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so                        
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.11                                                                   
PassengerRuby /usr/bin/ruby                                                                                             

<VirtualHost *:80>                                                                                                      

   DocumentRoot /opt/redmine/public                                                                                     

   PassengerDefaultUser www-data                                                                                        
   RailsEnv production                                                                                                  
   RailsBaseURI /                                                                                                       

   <Directory /opt/redmine/public>                                                                                      
      AllowOverride all                                                                                                 
      Options -MultiViews                                                                                               
   </Directory>                                                                                                         

   LogLevel info                                                                                                        
   ErrorLog ${APACHE_LOG_DIR}/redmine-error.log                                                                         
   CustomLog ${APACHE_LOG_DIR}/redmine.log combined                                                                     

</VirtualHost>

When attempting a push to a newly created project, I see:

$ git push asgard master
Counting objects: 137, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (99/99), done.
Writing objects: 100% (137/137), 16.14 MiB | 243 KiB/s, done.
Total 137 (delta 17), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 500
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

My Apache error log contains:

[ pid=47775 thr=139747320157952 file=ext/apache2/Hooks.cpp:860 time=2012-01-20 10:46:13.636 ]: Unexpected error in mod_p
assenger: An error occured while sending the request body to the request handler: Broken pipe (32)                      
  Backtrace:                                                                                                            
     (empty) 

And the Redmine log:

Processing GitHttpController#index (for 63.252.192.10 at 2012-01-20 10:46:13) [POST]
  Parameters: {"p1"=>"git-receive-pack", "p2"=>"", "p3"=>"", "action"=>"index", "id"=>"asgard", "path"=>"asgard.git", "controller"=>"git_http"}
  SQL (0.1ms)   SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings` 
  AnonymousUser Load (0.0ms)   SELECT * FROM `users` WHERE ( (`users`.`type` = 'AnonymousUser' ) ) LIMIT 1
  Project Load (0.1ms)   SELECT * FROM `projects` WHERE (`projects`.`identifier` = 'asgard') LIMIT 1
  Repository Load (0.0ms)   SELECT * FROM `repositories` WHERE (`repositories`.project_id = 1) LIMIT 1
  GitRepositoryExtra Load (0.1ms)   SELECT * FROM `git_repository_extras` WHERE (`git_repository_extras`.repository_id = 1) LIMIT 1
  Repository Load (0.1ms)   SELECT * FROM `repositories` WHERE (`repositories`.`id` = 1)
Filter chain halted as [:authenticate] rendered_or_redirected.
Completed in 10ms (View: 0, DB: 0) | 401 Unauthorized [http://www.asgard-platform.org/asgard.git/git-receive-pack]

My basic installation procedure for all this was:

  • Install Passenger from source
  • Check out the latest stable SVN of Redmine 1.3.x
  • Clone the latest gitolite
  • Run gl-system-install and gl-setup
  • Clone redmine_git_hosting
  • Configure all the various server names, database settings, etc. for Redmine and redmine_git_hosting.

I'm sure I've missed something with SmartHTTP. Looks like it's an authorization problem, but I can't find where.

Help? Please? Thanks!

@kubitron
Copy link

You probably need to make sure that password info is properly forwarded to the plugin. I don't use passenger, but for fcgid (an apache plugin), I needed to have something like the following in my conf file (in particular, the whole E=X-HTTP... piece is what is needed. I don't know how that translates to passenger, but I bet you can google it..:

<Location /redmine>
    RewriteEngine On
    # Let apache handle purely static files like images by itself.
    RewriteCond %{REQUEST_FILENAME} !-f

    # Send Everything else to Typo
    RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
</Location>

@sduensin
Copy link
Author

@kubitron Thanks for the tip. I'll begin Googling and report back.

@sduensin
Copy link
Author

Well, if that's the answer, I sure can't figure it out. Anyone else manage to make this work?

@Jehreg
Copy link

Jehreg commented Feb 18, 2012

+1 Having the same damn problem.

@iarspider
Copy link

+1 - same problem here, and no information about passing auth hreaders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants