yuki-kimoto / gitprep

Portable GitHub system into your own server
http://gitprep.yukikimoto.com/
912 stars 117 forks source link

404 Reading tree failed at /usr/share/perl/5.22/Carp.pm line 166 #127

Closed halilibrahim closed 7 years ago

halilibrahim commented 7 years ago

Hi, I'm getting server error on 2 of my repositories. When i browse to repository address i see the "we're sorry, something went very wrong!" raptor page. Also "Repositry is not yet created." title is displayed at search results (in the position of date label, below repository title). Here's the production.log

[Tue Jan 31 09:38:45 2017] [error] Gitprep::Git=HASH(0x364bff8)404Reading tree failed at /usr/share/perl/5.22/Carp.pm line 166.
161:     # Icky backwards compatibility wrapper. :-(
162:     local @CARP_NOT = $cgc ? $cgc->() : caller();
163:     shortmess_heavy(@_);
164: }
165: 
166: sub croak   { die shortmess @_ }
167: sub confess { die longmess @_ }
168: sub carp    { warn shortmess @_ }
169: sub cluck   { warn longmess @_ }
170: 
171: BEGIN {

git version 2.7.4 perl v5.22.1 built for x86_64-linux-gnu-thread-multi

Git works well with those repositories. Problem only affects frontend as far as i've seen. I've backup of my repositories to delete and re-create them on my gitprep server but i didn't fix them assuming you may need further information about the issue.

yuki-kimoto commented 7 years ago

What URL do you see?

Do you know what git command is executed?

halilibrahim commented 7 years ago

I see my repository URL as http://git.mydomain.com/myusername/my.project.name URL's of other repositories (which are in same format) are working fine.

I don't know which git command is executed. I can check if you direct me where to look.

yuki-kimoto commented 7 years ago

Can you check error place? Maybe tree command fail.

The URL is corresponding to templates/tree.html.ep

You can run development server.

./morbo

And add statements. For example.

warn "AAAAAAAAAA";
$trees = $git->trees(app->rep_info($user_id, $project_id), $rev, $dir);
warn"BBBBB"

If only "AAAAAAAAAAA" is displayed, the place is error place.

halilibrahim commented 7 years ago
my $trees;
if (defined $dir && length $dir) {
  $trees = $git->trees(app->rep_info($user_id, $project_id), $rev, $dir);
}
else {
  warn "DEBUG::1";
  $trees = $git->trees(app->rep_info($user_id, $project_id), $rev);
  warn "DEBUG::2";
}
fatal: bad revision 'develop'
DEBUG::1 at template /tree.html.ep line 45.
fatal: bad revision 'develop'
Use of uninitialized value $cmd[4] in open at /home/gitprep/gitprep/script/../lib/Gitprep/Git.pm line 1538.
fatal: Not a valid object name 
yuki-kimoto commented 7 years ago

Problem maybe branch name.

GitPrep try read "develop" branch, but the branch name "develop" is not invalid.

halilibrahim commented 7 years ago

Yes, the problem is the branch name. 'default_branch' value of the project (in gitprep.db) was pointing to missing branch 'develop'. I've updated the value to 'master' manually and now everything is ok.

I'm not working on those 2 corrupted projects. So, I don't know what exactly caused this but as far as i know; this was happened after an incomplete merge of develop branch.

Thank you for your assistance.