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

Updating Gem? #447

Closed
Sir-Will opened this issue Oct 30, 2020 · 15 comments
Closed

Updating Gem? #447

Sir-Will opened this issue Oct 30, 2020 · 15 comments
Labels

Comments

@Sir-Will
Copy link

Hello,

I tried updating few plugins and got this message from one of the plugins:

Redmine requires redmine_crm gem version 0.0.54 or higher (you're using 0.0.53).
Please update with 'bundle update redmine_crm'.

How do I run this command with docker? I tried adding it to post-install.sh but it seems to exit before that gets executed.

I also tried with a fresh tmp dir but then I get the Too many levels of symbolic links error like described in #412

@jcormier
Copy link
Collaborator

I also tried with a fresh tmp dir but then I get the Too many levels of symbolic links error like described in #412

It's expected that you destroy the container, every time you stop it. This is especially true when you delete the tmp directory.

@jcormier
Copy link
Collaborator

How do I run this command with docker? I tried adding it to post-install.sh but it seems to exit before that gets executed.

I think post-install.sh should get run every time you launch the container.
https://github.com/sameersbn/docker-redmine/search?q=install_plugins

. ${REDMINE_PLUGINS_DIR}/post-install.sh

It should print "Executing plugins/post-install.sh script..." if the script is getting run.

I suspect your issue might be related to not bringing the container down. but hard to say.

@Sir-Will
Copy link
Author

It's expected that you destroy the container, every time you stop it. This is especially true when you delete the tmp directory.

I did docker rm the redmine container (not memcached and postgresql).

It should print "Executing plugins/post-install.sh script..." if the script is getting run.

The scripts is being executed after "Installing plugins..." but the redmine container is being exited the moment redmine reaches plugin the code below.

requires_redmine_crm :version_or_higher => '0.0.54' rescue raise "\n\033[31mRedmine requires newer redmine_crm gem version.\nPlease update with 'bundle update redmine_crm'.\033[0m"

@jcormier
Copy link
Collaborator

I did docker rm the redmine container (not memcached and postgresql).
I see I think that should work, I exclusively using the docker-compose commands as I find them more intuitive. So am not certain what the appropriate docker command would be.

@jcormier
Copy link
Collaborator

Maybe this is a problem with the redmineup plugin? Someone posted something similar 6 months ago. https://www.redmineup.com/pages/help/crm/installing-redmine-crm-plugin-on-linux#comment-4877086020

@Sir-Will
Copy link
Author

I just looked at the log again, it shows "Migrating plugins. Please be patient, this could take a while...", so it seems to fail here:

exec_as_redmine bundle exec rake redmine:plugins:migrate

I also noticed that you can create a pre-install.sh file. Should the bundle update redmine_crm command work in there?

. ${REDMINE_PLUGINS_DIR}/pre-install.sh

redmine_1     | Installing plugins...
redmine_1     | Installing gems required by plugins...
redmine_1     | Your application has set without to "development:test". This will override the global value you are currently setting
redmine_1     | Migrating plugins. Please be patient, this could take a while...
redmine_1     | Redmine requires redmine_crm gem version 0.0.54 or higher (you're using 0.0.53).
redmine_1     | Please update with 'bundle update redmine_crm'.
wipli_redmine_1 exited with code 1

@jcormier
Copy link
Collaborator

jcormier commented Oct 31, 2020 via email

@Sir-Will
Copy link
Author

Sir-Will commented Jan 5, 2021

Apparently the plugin requires build-essential now. What would be the best way to add that to the dockerfile?

@jcormier
Copy link
Collaborator

jcormier commented Jan 5, 2021

The pre-install.sh script mentioned above is run as root, so you should be able to install build-essentials before plugins are migrated.

@La1x
Copy link

La1x commented Jun 4, 2024

Hello!
Same problem here.

I am trying to add bundle update redmine_crm in pre-install.sh script, but got Bundler attempted to update redmine_crm but its version stayed the same and then Redmine requires redmine_crm gem version 0.0.56 or higher (you're using 0.0.23). Please update with 'bundle update redmine_crm'.
I found this instruction, but cant figure out, how to do this in container.

So I have two questions:

  1. @Sir-Will, do you remember, how to update redmine_crm plugin?
  2. Does anyone has an idea, how to manual update redmine_crm by this this instruction ?

@jcormier
Copy link
Collaborator

jcormier commented Jun 4, 2024

@La1x, What version of the docker image are you using? What version of the CRM plugin?

@jcormier
Copy link
Collaborator

jcormier commented Jun 4, 2024

I just tested sameersbn/redmine:5.1.2-1 with redmine_crm-4_4_1-light.zip and it installed without issue and with no need for a pre/post install steps.

$ cd /srv/docker/redmine/redmine/plugins/
$ sudo unzip ~/Downloads/redmine_crm-4_4_1-light.zip 
$ cd -
$ docker compose up
WARN[0000] /home/jcormier/dockers/docker-redmine/docker-compose.yml: `version` is obsolete 
WARN[0000] Found orphan containers ([docker-redmine-mysql-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 2/2
 ✔ Container docker-redmine_postgresql_1  Recreated                                                      0.2s 
 ✔ Container docker-redmine_redmine_1     Recreated                                                      0.1s 
Attaching to postgresql-1, redmine-1
postgresql-1  | Initializing datadir...
postgresql-1  | Initializing certdir...
postgresql-1  | Initializing logdir...
postgresql-1  | Initializing rundir...
postgresql-1  | Setting resolv.conf ACLs...
postgresql-1  | Creating database user: redmine
postgresql-1  | Creating database: redmine_production...
postgresql-1  | ‣ Granting access to redmine user...
postgresql-1  | Starting PostgreSQL 14...
postgresql-1  | 2024-06-04 16:02:40.627 UTC [1] LOG:  starting PostgreSQL 14.8 (Ubuntu 14.8-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, 64-bit
postgresql-1  | 2024-06-04 16:02:40.628 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgresql-1  | 2024-06-04 16:02:40.628 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgresql-1  | 2024-06-04 16:02:40.639 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgresql-1  | 2024-06-04 16:02:40.647 UTC [80] LOG:  database system was shut down at 2024-06-04 16:02:40 UTC
postgresql-1  | 2024-06-04 16:02:40.652 UTC [1] LOG:  database system is ready to accept connections
redmine-1     | Initializing logdir...
redmine-1     | Initializing datadir...
redmine-1     | Symlinking dotfiles...
redmine-1     | Installing configuration templates...
redmine-1     | Configuring redmine...
redmine-1     | Configuring redmine::database
redmine-1     | Configuring redmine::logger...
redmine-1     | Configuring redmine::unicorn...
redmine-1     | Configuring redmine::secret_token...
redmine-1     | Generating a session token...
redmine-1     | Note:
redmine-1     |   All old sessions will become invalid.
redmine-1     |   Please specify the REDMINE_SECRET_TOKEN parameter for persistence.
redmine-1     |   **SHOULD** be defined if you have a load-balancing Redmine cluster.
redmine-1     | Configuring redmine::max_concurrent_ajax_uploads...
redmine-1     | Configuring redmine::sudo_mode...
redmine-1     | Configuring redmine::autologin_cookie...
redmine-1     | Configuring redmine::backups...
redmine-1     | Configuring redmine::rmagic::font...
redmine-1     | Configuring redmine::avatar::url...
redmine-1     | Configuring nginx...
redmine-1     | Configuring nginx::redmine...
redmine-1     | Installing plugins...
redmine-1     | Installing gems required by plugins...
redmine-1     | You are replacing the current local value of without, which is currently "development:test"
redmine-1     | Migrating plugins. Please be patient, this could take a while...
redmine-1     | == 16 CreateContacts: migrating ===============================================
redmine-1     | -- create_table(:contacts, {:id=>:integer})
redmine-1     |    -> 0.0109s
redmine-1     | -- add_index(:contacts, :author_id)
redmine-1     |    -> 0.0037s
redmine-1     | -- add_index(:contacts, :company)
redmine-1     |    -> 0.0037s
redmine-1     | -- add_index(:contacts, :is_company)
redmine-1     |    -> 0.0033s
redmine-1     | -- add_index(:contacts, :email)
redmine-1     |    -> 0.0036s
redmine-1     | -- add_index(:contacts, :first_name)
redmine-1     |    -> 0.0040s
redmine-1     | -- add_index(:contacts, :assigned_to_id)
redmine-1     |    -> 0.0037s
redmine-1     | == 16 CreateContacts: migrated (0.0330s) ======================================
redmine-1     | 
redmine-1     | == 17 CreateContactsRelations: migrating ======================================
redmine-1     | -- create_table(:contacts_deals, {:id=>false})
redmine-1     |    -> 0.0007s
redmine-1     | -- add_index(:contacts_deals, :deal_id)
redmine-1     |    -> 0.0033s
redmine-1     | -- add_index(:contacts_deals, :contact_id)
redmine-1     |    -> 0.0033s
redmine-1     | -- create_table(:contacts_issues, {:id=>false})
redmine-1     |    -> 0.0011s
redmine-1     | -- add_index(:contacts_issues, :issue_id)
redmine-1     |    -> 0.0036s
redmine-1     | -- add_index(:contacts_issues, :contact_id)
redmine-1     |    -> 0.0035s
redmine-1     | -- create_table(:contacts_projects, {:id=>false})
redmine-1     |    -> 0.0009s
redmine-1     | -- add_index(:contacts_projects, :project_id)
redmine-1     |    -> 0.0034s
redmine-1     | -- add_index(:contacts_projects, :contact_id)
redmine-1     |    -> 0.0034s
redmine-1     | == 17 CreateContactsRelations: migrated (0.0234s) =============================
redmine-1     | 
redmine-1     | == 18 CreateDeals: migrating ==================================================
redmine-1     | -- create_table(:deals, {:id=>:integer})
redmine-1     |    -> 0.0082s
redmine-1     | -- add_index(:deals, :contact_id)
redmine-1     |    -> 0.0064s
redmine-1     | -- add_index(:deals, :project_id)
redmine-1     |    -> 0.0037s
redmine-1     | -- add_index(:deals, :status_id)
redmine-1     |    -> 0.0033s
redmine-1     | -- add_index(:deals, :author_id)
redmine-1     |    -> 0.0036s
redmine-1     | -- add_index(:deals, :category_id)
redmine-1     |    -> 0.0034s
redmine-1     | == 18 CreateDeals: migrated (0.0287s) =========================================
redmine-1     | 
redmine-1     | == 19 CreateDealsRelations: migrating =========================================
redmine-1     | -- create_table(:deal_categories, {:id=>:integer})
redmine-1     |    -> 0.0085s
redmine-1     | -- add_index(:deal_categories, :project_id)
redmine-1     |    -> 0.0035s
redmine-1     | -- create_table(:deal_processes, {:id=>:integer})
redmine-1     |    -> 0.0044s
redmine-1     | -- add_index(:deal_processes, [:author_id])
redmine-1     |    -> 0.0034s
redmine-1     | -- add_index(:deal_processes, [:deal_id])
redmine-1     |    -> 0.0034s
redmine-1     | -- create_table(:deal_statuses, {:id=>:integer})
redmine-1     |    -> 0.0080s
redmine-1     | -- add_index(:deal_statuses, [:is_closed])
redmine-1     |    -> 0.0037s
redmine-1     | -- create_table(:deal_statuses_projects, {:id=>false})
redmine-1     |    -> 0.0011s
redmine-1     | -- add_index(:deal_statuses_projects, [:project_id, :deal_status_id])
redmine-1     |    -> 0.0041s
redmine-1     | == 19 CreateDealsRelations: migrated (0.0406s) ================================
redmine-1     | 
redmine-1     | == 20 CreateNotes: migrating ==================================================
redmine-1     | -- create_table(:notes, {:id=>:integer})
redmine-1     |    -> 0.0082s
redmine-1     | -- add_index(:notes, [:source_id, :source_type])
redmine-1     |    -> 0.0035s
redmine-1     | -- add_index(:notes, [:author_id])
redmine-1     |    -> 0.0034s
redmine-1     | == 20 CreateNotes: migrated (0.0152s) =========================================
redmine-1     | 
redmine-1     | == 21 CreateTags: migrating ===================================================
redmine-1     | == 21 CreateTags: migrated (0.0236s) ==========================================
redmine-1     | 
redmine-1     | == 22 CreateRecentlyVieweds: migrating ========================================
redmine-1     | -- create_table(:recently_vieweds, {:id=>:integer})
redmine-1     |    -> 0.0082s
redmine-1     | -- add_index(:recently_vieweds, [:viewed_id, :viewed_type])
redmine-1     |    -> 0.0034s
redmine-1     | -- add_index(:recently_vieweds, :viewer_id)
redmine-1     |    -> 0.0034s
redmine-1     | == 22 CreateRecentlyVieweds: migrated (0.0152s) ===============================
redmine-1     | 
redmine-1     | == 23 CreateContactsSettings: migrating =======================================
redmine-1     | -- create_table(:contacts_settings, {:id=>:integer})
redmine-1     |    -> 0.0087s
redmine-1     | -- add_index(:contacts_settings, :project_id)
redmine-1     |    -> 0.0035s
redmine-1     | == 23 CreateContactsSettings: migrated (0.0123s) ==============================
redmine-1     | 
redmine-1     | == 24 AddTypeToNotes: migrating ===============================================
redmine-1     | -- add_column(:notes, :type_id, :integer)
redmine-1     |    -> 0.0006s
redmine-1     | -- add_index(:notes, :type_id)
redmine-1     |    -> 0.0034s
redmine-1     | == 24 AddTypeToNotes: migrated (0.0040s) ======================================
redmine-1     | 
redmine-1     | == 25 AddFieldsToDeals: migrating =============================================
redmine-1     | -- change_column(:deals, :duration, :integer)
redmine-1     |    -> 0.0005s
redmine-1     | -- add_column(:deals, :due_date, :timestamp)
redmine-1     |    -> 0.0003s
redmine-1     | -- add_column(:deals, :probability, :integer)
redmine-1     |    -> 0.0003s
redmine-1     | == 25 AddFieldsToDeals: migrated (0.0033s) ====================================
redmine-1     | 
redmine-1     | == 26 CreateContactsQueries: migrating ========================================
redmine-1     | -- create_table(:contacts_queries, {:id=>:integer})
redmine-1     |    -> 0.0094s
redmine-1     | -- add_index(:contacts_queries, :project_id)
redmine-1     |    -> 0.0032s
redmine-1     | -- add_index(:contacts_queries, :user_id)
redmine-1     |    -> 0.0033s
redmine-1     | == 26 CreateContactsQueries: migrated (0.0160s) ===============================
redmine-1     | 
redmine-1     | == 27 ChangeDealsCurrencyType: migrating ======================================
redmine-1     | -- change_column(:deals, :currency, :string)
redmine-1     |    -> 0.0280s
redmine-1     | == 27 ChangeDealsCurrencyType: migrated (0.0281s) =============================
redmine-1     | 
redmine-1     | == 28 AddCachedTagListToContacts: migrating ===================================
redmine-1     | -- add_column(:contacts, :cached_tag_list, :string)
redmine-1     |    -> 0.0006s
redmine-1     | == 28 AddCachedTagListToContacts: migrated (0.0006s) ==========================
redmine-1     | 
redmine-1     | == 29 AddVisibilityToContacts: migrating ======================================
redmine-1     | -- add_column(:contacts, :visibility, :integer, {:default=>0, :null=>false})
redmine-1     |    -> 0.0004s
redmine-1     | == 29 AddVisibilityToContacts: migrated (0.0222s) =============================
redmine-1     | 
redmine-1     | == 30 ChangeDealStatusesIsClosed: migrating ===================================
redmine-1     | -- remove_column(:deal_statuses, :is_closed)
redmine-1     |    -> 0.0005s
redmine-1     | -- add_column(:deal_statuses, :status_type, :integer, {:default=>0, :null=>false})
redmine-1     |    -> 0.0005s
redmine-1     | == 30 ChangeDealStatusesIsClosed: migrated (0.0010s) ==========================
redmine-1     | 
redmine-1     | == 31 PopulateContactsModule: migrating =======================================
redmine-1     | == 31 PopulateContactsModule: migrated (0.0075s) ==============================
redmine-1     | 
redmine-1     | == 32 CreateAddresses: migrating ==============================================
redmine-1     | -- create_table(:addresses, {:id=>:integer})
redmine-1     |    -> 0.0083s
redmine-1     | -- add_index(:addresses, [:addressable_id, :addressable_type])
redmine-1     |    -> 0.0036s
redmine-1     | -- add_index(:addresses, :address_type)
redmine-1     |    -> 0.0039s
redmine-1     | -- remove_column(:contacts, :address)
redmine-1     |    -> 0.0003s
redmine-1     | == 32 CreateAddresses: migrated (0.0167s) =====================================
redmine-1     | 
redmine-1     | == 33 CreateDealsIssues: migrating ============================================
redmine-1     | -- create_table(:deals_issues, {:id=>:integer})
redmine-1     |    -> 0.0047s
redmine-1     | -- add_index(:deals_issues, :issue_id)
redmine-1     |    -> 0.0034s
redmine-1     | -- add_index(:deals_issues, :deal_id)
redmine-1     |    -> 0.0034s
redmine-1     | == 33 CreateDealsIssues: migrated (0.0115s) ===================================
redmine-1     | 
redmine-1     | == 34 ChangeDealsPricePrecision: migrating ====================================
redmine-1     | -- change_column(:deals, :price, :decimal, {:precision=>20, :scale=>2})
redmine-1     |    -> 0.0005s
redmine-1     | == 34 ChangeDealsPricePrecision: migrated (0.0005s) ===========================
redmine-1     | 
redmine-1     | == 35 DropRecentlyVieweds: migrating ==========================================
redmine-1     | -- drop_table(:recently_vieweds)
redmine-1     |    -> 0.0009s
redmine-1     | == 35 DropRecentlyVieweds: migrated (0.0009s) =================================
redmine-1     | 
redmine-1     | == 36 DropContactsSettings: migrating =========================================
redmine-1     | -- drop_table(:contacts_settings)
redmine-1     |    -> 0.0007s
redmine-1     | == 36 DropContactsSettings: migrated (0.0113s) ================================
redmine-1     | 
redmine-1     | Installing themes...
redmine-1     | 2024-06-04 21:33:00,748 INFO Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
redmine-1     | 2024-06-04 21:33:00,748 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
redmine-1     | 2024-06-04 21:33:00,748 INFO Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing
redmine-1     | 2024-06-04 21:33:00,748 INFO Set uid to user 0 succeeded
redmine-1     | 2024-06-04 21:33:00,750 INFO RPC interface 'supervisor' initialized
redmine-1     | 2024-06-04 21:33:00,750 INFO supervisord started with pid 1
redmine-1     | 2024-06-04 21:33:01,752 INFO spawned: 'unicorn' with pid 482
redmine-1     | 2024-06-04 21:33:01,753 INFO spawned: 'cron' with pid 483
redmine-1     | 2024-06-04 21:33:01,754 INFO spawned: 'nginx' with pid 484
redmine-1     | 2024-06-04 21:33:02,980 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
redmine-1     | 2024-06-04 21:33:02,980 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
redmine-1     | 2024-06-04 21:33:02,980 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
^CGracefully stopping... (press Ctrl+C again to force)
[+] Stopping 2/1
 ✔ Container docker-redmine-redmine-1     Stopped                                                        0.4s 
 ✔ Container docker-redmine-postgresql-1  Stopped                                                        0.0s 

@La1x
Copy link

La1x commented Jun 5, 2024

@jcormier , thank you for reply!
Docker image sameersbn/redmine:5.1.2-1.
Plugin redmine agile version 1.6.5 that depends on gem redmine_crm version 0.0.56 or higher.

I found solution: explicitly set version in plugin's Gemfile: gem "redmine_crm", "0.0.63"

Maybe this is a problem caused by plugin's Gemfile?

@jcormier
Copy link
Collaborator

jcormier commented Jun 5, 2024

Yeah, I'd guess you have two plugins with conflicting Gemfile dependencies.

@La1x
Copy link

La1x commented Jun 7, 2024

@jcormier , no, it's only one plugin.
I think there is problem with plugin and dependency repo - it's install wrong version due to lack of explicit version.

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

No branches or pull requests

3 participants