If I create a new project, I can click on it in my list and see the project just fine. However if I commit changes locally and push them to the remote I get an error trying to view the project's page, I get a 500 error. The production log shows the following error:
ActionView::Template::Error (undefined method `sha' for nil:NilClass):
39: = link_to project_compare_index_path(#project, from: #repository.root_ref, to: #ref || #repository.root_ref), class: 'btn btn-block' do
40: Compare code
41:
42: - if #repository.readme
43: - readme = #repository.readme
44: = link_to project_blob_path(#project, tree_join(#repository.root_ref, readme.name)), class: 'btn btn-block' do
45: = readme.name
app/models/repository.rb:177:in `tree'
app/models/repository.rb:161:in `block in readme'
app/models/repository.rb:160:in `readme'
app/views/projects/show.html.haml:42:in `_app_views_projects_show_html_haml___610828608301993518_70108750838020'
app/controllers/projects_controller.rb:69:in `block (2 levels) in show'
app/controllers/projects_controller.rb:63:in `show'
Started GET "/david/striker" for 99.73.162.163 at 2014-07-14 01:22:24 -0400
Processing by ProjectsController#show as HTML
I wanted to take a look at this in the console, but that doesn't seem possible. Unfortunately I don't know the password to the postgres database so I couldn't look inside the console either. It appears that the repository variable is nil inside the template.
Anyone have any ideas?
As mentioned in issue 417, check your Ruby version:
While reverting back to 6.9.2 I add the same exact problem, which made me revert the ruby version 2.1.2p95, to the one I add before: "ruby 2.1.0p0 (2013-12-25 revision 44422)" I gave another try to gitlab 7.0 with the old ruby version and the error described before does not happen anymore
So try to see if ruby 2.1.0 works (Dec. 2013), because a more recent ruby (like 2.1.2, May 2014) might not.
Related
This issue was discovered after upgrading from ChefDK 3.2.30 to 4.2.0, and everything worked fine before the upgrade (Including these two commands).
The full error from "knife node list":
C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/rbvmomi-1.13.0/lib/rbvmomi/vim.rb:8: warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead
Traceback (most recent call last):
8: from C:/opscode/chefdk/bin/knife:359:in <main>' 7: from C:/opscode/chefdk/bin/knife:359:inload'
6: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-15.1.36-universal-mingw32/bin/knife:24:in <top (required)>' 5: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-15.1.36-universal-mingw32/lib/chef/application/knife.rb:162:inrun'
4: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-15.1.36-universal-mingw32/lib/chef/knife.rb:221:in run' 3: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-15.1.36-universal-mingw32/lib/chef/knife.rb:440:inconfigure_chef'
2: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-15.1.36-universal-mingw32/lib/chef/knife.rb:185:in load_config' 1: from C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.1.36/lib/chef-config/workstation_config_loader.rb:72:inload'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.1.36/lib/chef-config/mixin/credentials.rb:92:in load_credentials': undefined local variable or methodcredentials_file' for #<ChefConfig::WorkstationConfigLoader:0x000000000c311e68> (NameError)
The full error from 'kitchen converge':
------Exception-------
Class: Kitchen::ClientError
Message: Could not load the 'chef_zero' provisioner. Error: undefined local variable or method `credentials_file' for #<ChefConfig::WorkstationConfigLoader:0x0000000006f176a0>
Did you mean? credentials_profile
credentials_found
#credentials_found
----------------------
Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration
We found that the problem in this case was an invalid profile being requested.
The profile can be set either with the CHEF_PROFILE environment variable, or in a file named 'context' in the users home .chef directory (~/.chef on Linux, C:\Users\username.chef on Windows).
If a profile other than 'default' is specified, than the ChefDK looks for a file named 'credentials' in that same directory. It will then parse that file and look for a section matching the profile name.
If it doesn't find a matching profile, then it will generate errors like the one in the question.
To fix the problem for this user, we changed the value of the 'context' file to "default" (without quotes) and everything started working again.
There are several possible resolutions, which one is best for you depends on where the problem comes from
If the profile name is valid, then add the proper section to the ~/credentials file
If the value of the CHEF_PROFILE environment variable is the problem, change it to "default" or to a valid name
If the value of the ~/context file is the problem, than you can either delete it, or change the value in it to a valid profile (NOTE: Always make a back up of the file before deleting or making changes)
I found the details listed above that led me to the resolution by going through the code in C:/opscode/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.1.36/lib/chef-config/mixin/credentials.rb (which was where the initial exception was thrown)
What is Issue?
When I push a link of the commit which invlolves a binary file from Commits view of a project on Gitlab, I recieve an Internal error ,"500 Whoops, something went wrong on our end."
This issue also appears when creating Merge Request whose origin is the same commit above.
Production.log says,
Started GET "/TempTest/bsp/commit/3098a49f2fd1c77be0c383994aa6655f5d15ebf8" for 127.0.0.1 at 2016-05-30 16:17:15 +0900
Processing by Projects::CommitController#show as HTML
Parameters:{"namespace_id"=>"TempTest", "project_id"=>"bsp", "id"=>"3098a49f2fd1c77be0c383994aa6655f5d15ebf8"}
Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
app/views/projects/diffs/_file.html.haml:54:in `_app_views_projects_diffs__file_html_haml__1070266479743635718_49404820'
app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml__2984561770205002953_48487320'
app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index'
app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml__2984561770205002953_48487320'
app/views/projects/commit/show.html.haml:12:in `_app_views_projects_commit_show_html_haml__3333221152053087461_45612480'
app/controllers/projects/commit_controller.rb:30:in `show'
lib/gitlab/middleware/go.rb:16:in `call'
Completed 500 Internal Server Error in 210ms (Views: 8.7ms | ActiveRecord: 10.5ms)
Gtilab seems to misdetect binary file with text file.
So HTML formatting engine seems to meet an error.("Encoding::CompatibilityError")
It's ok for me that Gitlab sometimes misdetects binary file with text file, but problem is that Gitlab server stops the transaction by Internal Error when such a misdetects occurs.
Could anyone tell me how to continue server transaction even if such a misjudge occurs?
For example, I assume the following answer.
e.g.1) Force to recognize a file to be a binary.
e.g.2) Bypass a HTML transforming when such a error occurs.
What I tried to resolve.
I added the description '*.XXX binary' to .gitattribute to confirm whether I can let a certain file recognize that it was binary file for Gitlab forcibly.
The Git client recognized the file to be binary file, and the diff did not output a text. However, there was no effect in Gitlab even if I did push it.
versions info
I faced this issue at first on Gitlab 8.6.2, but same issue occurs on 8.8.3.
I use git-2.7.2
Thank you.
I try to create a new entry in hosts.allow
augeas { "Add in hosts allow" :
context => '/files/etc/hosts.allow',
changes => [
'ins 01 after *[last()]',
'set 01/process[1] ssh',
'set 01/process[2] ssh2',
'set 01/client ipaddr'
],
}
But it doesn't work I get this error
Notice: Compiled catalog for server.local in environment production in 0.96 seconds
Error: /Stage[main]/Nfs::Server/Augeas[Add in hosts allow]: Could not evaluate: Error sending
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]/Error sending
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]
I can't see how to use the ins command, the message don't let me know what's went wrong.
CentOS6.4
Puppet version: 3.3.1
augeasversion (from facter): 0.9.0
I Can't find the version of augtools and I can't either execute a command as it is not installed (I don't know how puppet invoke it)
Try adding a leading "/" to the context?
(The logging is slightly odd, it doesn't show the "files" prefix at all, I wonder if your code sample and logging match.)
I am trying to run locally Orchard.Azure.CloudService project without any code changes to the official stable release 1.7.1 (58c21815). full source address is # https://git01.codeplex.com/orchard .
Here is the steps to reproduce the error:
launch the Orchard.Azure solution
select "Debug" build
click on press F5 start debugging
the page will show "Server Error in '/' Application."
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters: Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
Source Error:
Line 111: var shellScope = _shellContainerFactory.CreateContainer(settings, blueprint);
Line 112:
Line 113: return new ShellContext {
Line 114: Settings = settings,
Line 115: Descriptor = descriptor,
Source File: c:\projects\orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs Line: 113
`
... "
Windows 8, x64
VS2012.3 Azure SDK 2.1
source code version hash: 58c21815
It is a known issue that the solution can't run in the emulator. This is caused by the structure of the solution, and the fact the emulator doesn't run the cspack file. This script is used to copy modules and themes into the package for Azure deployment. When the emulator runs it simply mounts the Orchard.Azure.Web project which is almost empty and doesn't have all the files necessary to run the solution.
See this discussion on CodePlex for more detail.
I don't believe you should be running that solution but the main Orchard solution.
ie, you don't need to develop specifically for Azure, just deploy for Azure.
I think ^_^
I was running GitLab 5.2 I believe on FreeBSD 9.1-RELEASE for months and things were going well, no obvious issues I could see.
I've recently upgraded to 6.0 following the guide provided on gitlab.org, unfortunately I'm now getting errors like the following:
No such file or directory - posix_spawnp
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:187:in `_pspawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:187:in `pspawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:160:in `spawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in `popen4'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn/child.rb:105:in `exec!'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn/child.rb:80:in `initialize'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:341:in `new'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:341:in `native'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:368:in `method_missing'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/repo.rb:558:in `log'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:180:in `log'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/commit.rb:52:in `find'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/commit.rb:64:in `last'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:90:in `has_commits?'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:96:in `empty?'
/tank/gitlab/gitlab/app/models/repository.rb:17:in `empty?'
/tank/gitlab/gitlab/app/models/project.rb:345:in `empty_repo?'
/tank/gitlab/gitlab/lib/tasks/gitlab/check.rake:519:in `block in check_repos_post_receive_hooks_is_link'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block (2 levels) in find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block in find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:72:in `find_in_batches'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:20:in `find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/querying.rb:8:in `find_each'
I'm definately not an expert but I'm not sure if FreeBSD offers any posix compatibility. I've manually installed the posix-spawn gem but it made no difference. I was unable to find help through my searching, the only similar cases I could see came down to missing pygments but I have that installed.
Is it not possible to use GitLab on FreeBSD with the later versions? I see that the unofficial FreeBSD/GitLab install guides are only for 5.1 and 5.2 so that might be an indication. It would be a shame if this is so, GitLab is a great piece of software and I hate to have to drop it.
Appreciate some insights, thanks
Make sure the correct path to git is set in gitlab/config/gitlab.yml as FreeBSD installs ports/packages to /usr/local by default:
git:
bin_path: /usr/local/bin/git
Then restart GitLab.
How to debug this:
Print the vars of the function in to gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb on line 187 (adjust if needed):
puts "DEBUG"
puts env
puts argv
puts options
_pspawn(env, argv, options)
Run Application Status:
# bundle exec rake gitlab:check RAILS_ENV=production
{}
[["/usr/bin/git", "/usr/bin/git"], "--git-dir=/home/git/repositories/root/git-playground-project.git", "rev-parse", "HEAD"]
{:in=>#<IO:fd 13>, #<IO:fd 14>=>:close, :out=>#<IO:fd 16>, #<IO:fd 15>=>:close, :err=>#<IO:fd 18>, #<IO:fd 17>=>:close}
Find the debug lines and verify the parameters.
Good luck!