ericpaulbishop/redmine_git_hosting — Issue #141: SmartHTTP 401 Unauthorized
Author: sduensin
Created: 2012-01-20 19:04:44+00:00
State: open

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

DocumentRoot /opt/redmine/public

PassengerDefaultUser www-data
RailsEnv production
RailsBaseURI /

AllowOverride all
Options -MultiViews

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

```

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!