Another GitLab "Can't save project. Please try again later" - ruby

I did a fresh install from source of GitLab 7.2 stable (7.2.1) and when I try to create a project I get the message:
Can't save project. Please try again later
Although, I can create users and groups just fine.
I modified the /gitlab/app/services/projects/create_service.rb to print the exception error message and it says:
undefined local variable or method `tagging_contexts' for #<Project:0xb983b318>
Searching through the gems folder, it looks like it is related to gem acts-as-taggable-on-3.4.1
The Gemfile and Gemfile.lock have that reference in place. And I also have it in the directory gitlab/vendor/bundle/ruby/2.1.0/gems.
Does anyone know why am I getting this error and how to fix it?
Information about the system:
Installation on ODROID-XU3 was based on https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md and https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/database_mysql.md, but I had to remove gems pg and therubyracer. Gem jquery-ui-rails I had to force version "~> 4.2.1".
Git-core and Ruby were built from source. Redis-server and Redis-tools were installed from package version 2.8.4-2.
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.7.2
Rake Version: 10.3.2
Sidekiq Version:2.17.0
GitLab information
Version: 7.2.1
Revision: ff1633f
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://192.168.1.150
HTTP Clone URL: http://192.168.1.150/some-project.git
SSH Clone URL: git#192.168.1.150:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.9.7
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.9.7 ? ... OK (1.9.7)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... can't check, you have no projects
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories/: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.4
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ... can't check, you have no projects
Projects have satellites? ... can't check, you have no projects
Redis version >= 2.0.0? ... yes
Ruby version >= 2.0.0 ? ... yes (2.1.2)
Your git bin path is "/usr/local/bin/git"
Git version >= 1.7.10 ? ... yes (2.1.0)
Checking GitLab ... Finished

Related

Using a custom path while using system gems is unsupported

Gitlab CI bundle install giving unexpected error. It was working perfectly fine till yesterday evening.
Referred to below solution but issue still persist:
bundler: Using a custom path while using system gems is unsupported
stages:
- test
cache:
key: test-app-cache
paths:
- vendor/
variables:
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_PATH__SYSTEM: "false"
deploy:
stage: test
image: "ruby:2.5"
script:
- gem update system
- gem install bundler -v 2.0.1
- bundle config --global disable_shared_gems true
- bundle install --path vendor
Skipping Git submodules setup
Checking cache for test-app-cache-9...
FATAL: file does not exist
Failed to extract cache
$ gem update system
Updating installed gems
Nothing to update
$ gem install bundler -v 2.0.1
Successfully installed bundler-2.0.1
1 gem installed
$ bundle config --global disable_shared_gems true
You have a bundler environment variable for disable_shared_gems set to "true". This will take precedence over the global value you are setting
$ bundle install --path vendor
Using a custom path while using system gems is unsupported.
path:
Set for your local app (/usr/local/bundle/config): "vendor"
Set via BUNDLE_PATH: "/usr/local/bundle"
path.system:
Set via BUNDLE_PATH__SYSTEM: true
disable_shared_gems:
Set via BUNDLE_DISABLE_SHARED_GEMS: true
Set for the current user (/root/.bundle/config): true
ERROR: Job failed: command terminated with exit code 1

fluent custom plugin registration throws "Unknown output plugin"

I am trying to modify an existing Fluentd plugin and use it with my customization. So I :
git cloned the plugin repo from github. git clone <url>
Edited my changes
gem build plugin.gemspec
gem install plugin.gem
Created a config mentioning the type of plugin
Ran fluentd -c <fluend_conf.conf> -vv
And I ended up getting this in fluentd log(fluent-plugin-swift is the plugin I edited and the type of the plugin is 'swift'):
2017-03-22 15:00:27 +0000 [info]: fluent/engine.rb:126:block in configure:
gem 'fluent-plugin-swift' version '0.0.1'
2017-03-22 15:00:27 +0000 [error]: fluent/supervisor.rb:369:rescue in
main_process: config error file="fluend_conf.conf" error="Unknown output plugin
'swift'. Run 'gem search -rd fluent-plugin' to find plugins"
EDIT-1: For clarifications
I have also checked the naming convention of the plugin that is to be registered.
The plugin is present in <base_dir>/lib/fluent/plugin/.
Also the name of file is out_swift.rb. And finally
inside the file, the plugin gets registered as:
Fluent::Plugin.register_output('swift', self)
Also is there any way, I can check the list of registered plugins, and the name it uses to get registered to fluend?
NOTE:
The same had previously worked for me, I had to re-do this as someone had formatted the machine I had my changes.
Please let me what is wrong in my approach?
The problem could be with the installation path, Please check the following, :
Type gem environment
You will get to see the INSTALLATION DIRECTORY like:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.8
- RUBY VERSION: 2.4.0 (2016-12-24 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.4.0
- USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.4.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
Go inside the INSTALLATION DIRECTORY directory, now do
cd gem/<ur_custom_plugin>
Now check whether, your files are there or not.
If not, you got your answer.
SOLUTION:
Simply copy your files to this directory and start fluentd
As the above mentioned, this may related to which gem you used to install the plugin, for my case in CentOS7, the td-agent-gem as below works:
td-agent-gem install <pluginname>
install ruby development environment
brew install rbenv
now run fluentD from ruby environment
~/.rbenv/shims/fluentd
this refers /etc/fluent/fluent.conf
Installing the plugin from ruby environment
~/.rbenv/shims/gem install fluent-plugin-rewrite-tag-filter

Getting 502 on gitlab when adding repositories, users or doing other actions

Usually fixed by refreshing (re-sending POST) the browser multiple times.
# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System: Debian 7.8
Current User: git
Using RVM: no
Ruby Version: 2.1.5p273
Gem Version: 2.2.2
Bundler Version:1.8.2
Rake Version: 10.3.2
Sidekiq Version:3.3.0
GitLab information
Version: 7.8.0
Revision: 44c69cb
Directory: /home/git/gitlab
DB Adapter: postgresql
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 2.5.3
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
The server itself has 4GB RAM available and multicore cpu. The error comes instantly so it does not seem to be an memory or timeout problem.
I posted the bug here: https://bugs.ruby-lang.org/issues/10872 but it was closed as invalid.
I have no clue how ruby works so no idea what I am looking at or looking for.
For future reference: turns out GitLab does not run on Debian 7 32Bit - I can not say for sure, but doubt it has to do with the versions in Debian's 7 repository (which are in general older) as I compiled most of the stuff and with gem it anyway got the versions as defined by GitLab.
Very likely GitLab (or gems it is using) does not currently work on a 32Bit system.

Commit details not show after upgrade gitlab from 6-7-stable to any other version

I have Gitlab Community Edition 6-7-stable with. When I upgrade it to any other version, I cannot see commit details at all -- error 500. As I can see, all gitlab work perfectly after upgrade, except "little" trouble above.
production.log;
Started GET "/myproject-ru/myproject_ru_rating/commit/b01d59be5ac7345c2eef984018b9cf6a1c3697e0" for 94.190.193.26 at 2014-12-15 07:36:06 -0500
Processing by Projects::CommitController#show as HTML
Parameters: {"project_id"=>"myproject-ru/myproject_ru_rating", "id"=>"b01d59be5ac7345c2eef984018b9cf6a1c3697e0"}
Completed 500 Internal Server Error in 190ms
NoMethodError (undefined method `system=' for #<Note:0xacc4548>):
app/models/project.rb:269:in `build_commit_note'
app/controllers/projects/commit_controller.rb:25:in `show'
app/controllers/application_controller.rb:59:in `set_current_user_for_thread'
root#gitlab:/home/git/gitlab# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System: Debian 7.7
Current User: git
Using RVM: no
Ruby Version: 1.9.3p545
Gem Version: 1.8.23.2
Bundler Version:1.7.9
Rake Version: 10.3.1
Sidekiq Version:2.17.0
GitLab information
Version: 6.9.2
Revision: e46b644
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://my.git.host
HTTP Clone URL: http://my.git.host/some-project.git
SSH Clone URL: git#my.git.host:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.9.4
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
Command
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
show all items green.
I tried upgrade to latest version -- problem persists.
I tried rebuild all bundles and recompile assets -- problem persists.
I tried upgrade ruby to latest version -- problem persists.
I tried set up fresh Gitlab 6-7-stable, migrate my data to it and then upgrade this installation -- problem persists.
Any ideas will be great.

Gitlab pull push not working

OVERVIEW
I am using Gitlab server locally in ubuntu 13.10 and I got following output in these command
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System: Ubuntu 13.10
Current User: git
Using RVM: no
Ruby Version: 2.0.0p247
Gem Version: 2.0.3
Bundler Version:1.5.3
Rake Version: 10.1.0
GitLab information
Version: 6.0.2
Revision: 10b0b8f
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://192.168.0.104
HTTP Clone URL: http://192.168.0.104/some-project.git
SSH Clone URL: git#192.168.0.104:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.7.0
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
xxx#xxx:/home/git/gitlab$ cd /home/git/
Now I sucessfully logged into the server with admin#local.host and create member and project. Then when I clone to the new project called testgitlab
by git clone http://192.168.0.104/sss/testgitlab.git
I could clone the project.
PROBLEM
1. When I try to commit the project I could do that. After commiting the project when I try to pull the Project git pull origin master then following error occurs:
:~/Desktop/testgitlab$ git pull origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss#192.168.0.104':
fatal: Couldn't find remote ref master
Unexpected end of command stream
2. After I get unsucessful in pulling the project I tried to push the project:
~/Desktop/testgitlab$ git push origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss#192.168.0.104':
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find json-1.7.7 in any of the sources (Bundler::GemNotFound)
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: error: hook declined to update refs/heads/master
To http://192.168.0.104/username/testgitlab.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.0.104/sss/testgitlab.git'
When checking the gitlab status
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...
Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.7.0 ? ... OK (1.7.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
Administrator / sesh ... repository is empty
sss / TestGitlab ... repository is empty
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Checking Sidekiq ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ...
Administrator / sesh ... can't create, repository is empty
sss / TestGitlab ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)
Checking GitLab ... Finished
I cannot figure out what I am missing ....
Help me out .
Thank you in advace !!!
I had a problem related to the issue 3384 that #Jonathan is referring to.
I solved it allowing the git user to login (modifying the /etc/passwd to set the shell to bash for the git user).
See my answer here: GitLab 7-0 stable not able to push or clone
An issue on github indicates, that it might have something to do with the unicorn/nginx/gitlab-shell configuration. Make sure to double check all the configs:
https://github.com/gitlabhq/gitlabhq/issues/3384

Resources