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

[Discourse] Can not change Discourse version using documentation instructions #1160

Open
ByteMoT opened this issue Sep 22, 2023 · 7 comments
Assignees
Labels
discourse on-hold Issues or Pull Requests with this label will never be considered stale tech-issues The user has a technical issue about an application

Comments

@ByteMoT
Copy link

ByteMoT commented Sep 22, 2023

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

42b6f606-77e3-5d4f-666e-4c7668cf4258

bndiagnostic output

[Connectivity]

Server ports 22, 80 and/or 443 are not publicly accessible. Please check the
following guide to open server ports for remote access:

This is Limited via Security Group at the moment, we can access the discourse install without issue.

bndiagnostic was not useful. Could you please tell us why?

Found and issue that we are not having a problem with

Describe your issue as much as you can

I want to preface this issue is that the normal running releases for Discourse usually include test passed branch and I think Bitnami has chosen to use "production", the issue that arises is if anyone wants to backup and then restore to the Bitnami discourse their default install will be a newer version and wont restore.

I am hoping we can figure out the issue here, I can screen-share if needed to sort out the issue or help troubleshoot

Source:
https://meta.discourse.org/t/is-discourse-always-in-beta/198215/19

They run closer to the edge on production environments as the production branch is like ever 4-6 months it updates(which could be a security problem as they patch fast but production does not see it till much later)

From their own config file:

## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

As it sits now I have our site I am trying to bring into the Bitnami AWS image

Discourse current installed version 3.2.0.beta2-dev
image

Bitnami installed version
image
Using the instructions provided here: https://docs.bitnami.com/general/apps/discourse/administration/upgrade/#troubleshooting

We have been unable to upgrade to a newer version of Discourse, when running this section of the documentation it can not access anything in the .git directory as the user that owns it is daemon and outputs:

git checkout Gemfile*
fatal: Unable to create '/opt/bitnami/discourse/.git/index.lock': Permission denied
git checkout bin
git stash
git fetch
git checkout tags/vLATEST-VERSION
git stash apply
bitnami@ip-18888:/opt/bitnami/discourse/.git$ ls -alh
total 12M
drwxr-xr-x  6 daemon daemon 4.0K Sep 22 19:15 .
drwxr-xr-x 24 daemon daemon 4.0K Sep 22 19:11 ..
-rw-r--r--  1 daemon daemon  129 Sep 13 00:28 config
-rw-r--r--  1 daemon daemon      97 Sep 22 19:14 FETCH_HEAD
-rw-r--r--  1 daemon daemon   41 Sep 13 00:28 HEAD
drwxr-xr-x  2 daemon daemon 4.0K Sep 13 01:09 hooks
-rw-r--r--  1 daemon daemon   3.9M Sep 22 19:13 index
-rw-r--r--  1 daemon daemon    3.9M Sep 22 19:13 index.stash.8567
-rw-r--r--  1 daemon daemon    3.9M Sep 22 19:13 index.stash.8712
drwxr-xr-x  2 daemon daemon 4.0K Sep 13 01:09 info
drwxr-xr-x  7 daemon daemon 4.0K Sep 22 19:14 objects
drwxr-xr-x  4 daemon daemon 4.0K Sep 13 01:09 refs
-rw-r--r--  1 daemon daemon   41 Sep 13 00:28 shallow

I attempted to change the ownership to bitnami (not touching the group level) and was able to run but hit a snag rather fast.|

bitnami@ip-8888:/opt/bitnami/discourse/.git$ cd ..
bitnami@ip-8888:/opt/bitnami/discourse$ git checkout Gemfile*
Updated 0 paths from the index
bitnami@ip-8888:/opt/bitnami/discourse$ git checkout bin
Updated 0 paths from the index
bitnami@ip-8888:/opt/bitnami/discourse$ git stash
error: 'plugins/chat/README.md' is beyond a symbolic link
fatal: Unable to process path plugins/chat/README.md
@ByteMoT ByteMoT added the tech-issues The user has a technical issue about an application label Sep 22, 2023
@github-actions github-actions bot added the triage Triage is needed label Sep 22, 2023
@ByteMoT
Copy link
Author

ByteMoT commented Sep 22, 2023

I do not see a way to change the discourse version like their documentation states

https://meta.discourse.org/t/configure-a-supported-tracking-branch-to-get-discourse-software-updates/17014

@jotamartos
Copy link
Collaborator

Please take a look at our documentation to know how to upgrade Bitnami Discourse

https://docs.bitnami.com/general/apps/discourse/administration/upgrade/

@ByteMoT
Copy link
Author

ByteMoT commented Sep 25, 2023

@jotamartos if you read my post you will see I am following that documentation and there is issues with it, the main reason I opened this ticket is to point that out to you guys.

Attempting to follow under the section Keeping In Sync With The Discourse Repository At GitHub I followed it to a T and it does not work properly.

Anyway you can close the issues if you want, the documentation would not work and we could not get the FRESH backup from a normal discourse install to restore to your image. I would rather you didn't close it though as I am sure I am running a fresh made AMI in AWS and when following the directions there is an issue and I would hope that you would want to ensure this issue is just me or if your software stack may have a issue.

@ByteMoT
Copy link
Author

ByteMoT commented Sep 25, 2023

At the end of the day your Discourse install is running a way out of date version compared to when the developers themselves suggest, I understand the stability of running the more production level but why would they suggest not running it?

@jotamartos
Copy link
Collaborator

Hi @ByteMoT,

I just reviewed the documentation and the issue you are running into and you are basically running into a permissions issue.

You can either run the command as daemon

sudo su daemon -s /bin/bash -c "COMMAND HERE"

or run the command using sudo and then ensure that the permissions are correctly set to the daemon user

sudo COMMAND HERE
sudo chown daemon:daemon LIST OF CHANGED FILES HERE

At the very beginning, I misread the information and thought that there was not a .git folder, but that folder exists and allows you modify the discourse folder according to the documentation.

I understand the stability of running the more production level but why would they suggest not running it?

That's something to ask to the developers. We take the non-beta versions from the github repository to build our solutions

https://github.com/discourse/discourse/tags

As you can see, those non-beta solutions are also updated frequently so there shouldn't be big changes apart from the new features they include in a new minor/major version.

@ByteMoT
Copy link
Author

ByteMoT commented Sep 29, 2023

Hi @ByteMoT,

I just reviewed the documentation and the issue you are running into and you are basically running into a permissions issue.

You can either run the command as daemon

sudo su daemon -s /bin/bash -c "COMMAND HERE"

or run the command using sudo and then ensure that the permissions are correctly set to the daemon user

sudo COMMAND HERE
sudo chown daemon:daemon LIST OF CHANGED FILES HERE

At the very beginning, I misread the information and thought that there was not a .git folder, but that folder exists and allows you modify the discourse folder according to the documentation.

I understand the stability of running the more production level but why would they suggest not running it?

That's something to ask to the developers. We take the non-beta versions from the github repository to build our solutions

https://github.com/discourse/discourse/tags

As you can see, those non-beta solutions are also updated frequently so there shouldn't be big changes apart from the new features they include in a new minor/major version.

By default the permissions were NOT daemon, I did check permissions as you have stated in your reply
I attempted to change the ownership to bitnami (not touching the group level) and was able to run but hit a snag rather fast.

The issue I have is if I follow your documentation on a FRESH AWS AMI Launch I should not be running into any issues doing a simple git pull, the point of me opening the ticket was to address that issue

From what I can see either either your image setup or your documentation is out of date / not working right.

As for the versioning issue, I understand the control is not there but I think it makes your images probably not really useful, The defaults for Discourse will put you out of date as soon as your AMI is launched creating an issue where users running the Discourse recommenced setups can not use your image as the backups are not backwards compatible to restore.
(Fresh installs obviously are not an issue )

The issue that made me spawn this ticket is I wanted to get to their recommended release version and I could not when following your documentation to a T. If the commend was meant to be ran as SU / SUDO it should state that, I am familiar with how to run commends as other users but was not expecting your image to be broken slightly.

https://docs.bitnami.com/general/apps/discourse/administration/upgrade/#keeping-in-sync-with-the-discourse-repository-at-github

The reason I had attempted to use your images was I was wanting something to deploy with speed and security and was not expecting to have to use alternative documentation than discourse's to update discourse. I have since terminated the Bitnami instance as it was 10x faster to just deploy an AWS Ubuntu Image with Docker and follow Discourse's setup process than make yours work.

Please feel free to close the ticket if you feel you must but I hope that the documentation and/or the image get reviewed as having permission issues out of the box is not a good look, bad things can happen if there are permissions set on the wrong files with Discourse being a web facing software.

@jotamartos
Copy link
Collaborator

Thank you for your suggestions. I'll create an internal ticket to review that section of the documentation and the solution itself to avoid issues in the future.

@github-actions github-actions bot added on-hold Issues or Pull Requests with this label will never be considered stale and removed triage Triage is needed labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discourse on-hold Issues or Pull Requests with this label will never be considered stale tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

2 participants