Locations Plugin

Glad you got it working. It’s been a while since I used the plugin so it was kinda my best guess.

1 Like

@angus I’ve noticed this issue recently when people don’t have a location entered on their profile:

Screen Shot 2020-04-21 at 21.18.40

Screen Shot 2020-04-21 at 21.18.05

It’s not occurring on every user though, can’t quite work out the pattern to it.

Maybe those who have deleted a location on their profile? Or maybe it’s and empty string eg “”, rather than NULL? :thinking:

It looks like the recent update removed the location from the user card altogether.

User card:

User profile:

2 Likes

This is very likely caused by this change in core:

4 Likes

@omarfilip @david Thanks for the insight :+1:t2:

@angus is this something you’ll be able to modify?

2 Likes

@david @Richie Thanks, this plugin has been updated to support the change.

https://github.com/paviliondev/discourse-locations/commit/5c762ccc1f34d190fafec49498e95a395c73c2bb

Just a heads up that this plugin will soon be moving to the same update schedule as the rest of Pavilion’s main plugins. This means that it will be brought in line with the latest Discourse core in the first week of every month. Details to follow specific to this plugin, but see further here:

4 Likes

Thanks for the quick fix, Angus.

2 Likes

Hi @angus confirmed the locations are now displaying on the user card but we’re still seeing the issue whereby some users have a map pin and map icon showing even if they don’t have a location entered:

image

And on their full profile page:

1 Like

I cannot start the Discourse app because of the locations plugin currently. Attaching log below, it works if I comment out locations in app.yml. Can someone prioritize this and fix it?

Also, is there a way to only upgrade to tests-passed version of the plugin (if there is such a thing), like how the main discourse app does? So that we do not run into such issues in future.

Log
5: from /var/www/discourse/plugins/discourse-layouts/plugin.rb:49:in `block in activate!'
4: from /var/www/discourse/lib/discourse_event.rb:13:in `trigger'
3: from /usr/local/lib/ruby/2.6.0/set.rb:338:in `each'
2: from /usr/local/lib/ruby/2.6.0/set.rb:338:in `each_key'
1: from /var/www/discourse/lib/discourse_event.rb:14:in `block in trigger'
/var/www/discourse/plugins/discourse-locations/plugin.rb:234:in `block in activate!': uninitialized constant DiscourseLayouts::WidgetHelper
Did you mean?  DiscourseLayouts::WidgetSerializer (NameError)

** INCOMPATIBLE PLUGIN **

You are unable to build Discourse due to errors in the plugin at
/var/www/discourse/plugins/discourse-locations

Please try removing this plugin and rebuilding again!
I, [2020-04-25T20:32:06.399307 #1]  INFO -- : gem install icalendar -v 2.4.1 -i /var/www/discourse/plugins/discourse-events/gems/2.6.5 --no-document --ignore-dependencies --no-user-install
HEADS UP! iCalendar 2.0 is not backwards-compatible with 1.x. Please see the README for the new syntax

HEADS UP! icalendar 2.2.0 switches to non-strict parsing as default. Please see the README if you
rely on strict parsing for information on how to enable it.

ActiveSupport is required for TimeWithZone support, but not required for general use.
Successfully installed icalendar-2.4.1
1 gem installed
gem install geocoder -v 1.4.4 -i /var/www/discourse/plugins/discourse-locations/gems/2.6.5 --no-document --ignore-dependencies --no-user-install
Successfully installed geocoder-1.4.4
1 gem installed

I, [2020-04-25T20:32:06.400580 #1]  INFO -- : Terminating async processes
I, [2020-04-25T20:32:06.400773 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 50
I, [2020-04-25T20:32:06.400979 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 167
167:signal-handler (1587846726) Received SIGTERM scheduling shutdown...
2020-04-25 20:32:06.401 UTC [50] LOG:  received fast shutdown request
2020-04-25 20:32:06.403 UTC [50] LOG:  aborting any active transactions
2020-04-25 20:32:06.406 UTC [50] LOG:  worker process: logical replication launcher (PID 59) exited with exit code 1
167:M 25 Apr 2020 20:32:06.406 # User requested shutdown...
167:M 25 Apr 2020 20:32:06.406 * Saving the final RDB snapshot before exiting.
2020-04-25 20:32:06.409 UTC [54] LOG:  shutting down
2020-04-25 20:32:06.439 UTC [50] LOG:  database system is shut down
167:M 25 Apr 2020 20:32:06.502 * DB saved on disk
167:M 25 Apr 2020 20:32:06.502 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 13098 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
b5a02d7f9df6b6a9dc160e269de30eef49bb0aeaf5dcb1b712bab5e6edad4030
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
root@discuss:/var/discourse#
1 Like

@k4rtik Thanks for your report, and sorry you’ve been impacted. Your issue arose because:

  1. The layouts plugin was updated 2 days ago.
  2. The locations plugin was supporting the existing version of the layouts plugin.
  3. You use both plugins.
  4. You updated your Discourse in between the initial update of the layouts plugin and support being added to the locations plugin.

I’ve updated the locations plugin to support the new layouts plugin version: https://github.com/paviliondev/discourse-locations/commit/52aec30461f8439c6658fdc401127cb52881ab49. When you update now with both plugins installed, it will work. @Richie This will fix your issue: https://github.com/paviliondev/discourse-locations/commit/51850630187c43df8e2c8186a2943e20eeaadda2

Having a tests-passed branch in the plugin would unforatunately not help too much in this particuar situation, or a not-insignificant portion of other plugin incompatibility situations. People update at many different frequencies and have many different combinations of customisations.

That said, we’re starting to make some steps to address this problem. We’re moving to a schedule of ensuring Pavilion’s primary open source plugins (this plugin, Events, Topic List Previews etc) are up to date with Discourse every 24 hours in the first 5 days of every month, starting May 1 to 5.

This gives you a safe window to update all the plugins on try.thepavilion.io along with Discourse itself with greater certainty that:

  1. You won’t experience conflicts between the plugin and Discourse, and if you do they will be addressed within less than 24 hrs.

  2. You won’t experience any issues due to changes in the plugin itself. Any potentially breaking changes to the plugin itself will happen outside this window.

This applies to all the plugins listed here:

This list may be expanded over time. See further: https://try.thepavilion.io.

If you have any questions about this, feel free to PM me, or contact us over at thepavilion.io.

5 Likes

Thanks, yeah, I was trying to figure out why my custom layout was not showing up either with the last update. It still doesn’t seem to appear but I see on Pavilion that you are in the process to release updated doc for the changes in the plugin so I will wait a while.

1 Like

@angus confirmed - issue resolved :clap:t2:

Thanks again for your continued support of this plugin :smiley:

3 Likes

Hi @angus I saw a notification to say the first post in this thread was edited.

Looks like the location of the repo has moved.

Should we all update our discourse settings to the new location or will the existing / old location still be updated?

Do we need to rebuild anything after changing the plugin source location?

2 Likes

Hey @Richie, you can continue using the old url of https://github.com/angusmcleod/discourse-locations. You can wait to update it when you naturally get a chance, i.e. you have to rebuild your site for some other reason.

The plugin was transferred from my personal github to Pavilion’s some time ago. When a repository is transferred, Github automatically redirects all links to the old location to the new one.

The first post will be changing a bit more in the coming weeks. I’m going to write some documentation for this over on thepavilion.io and a shorter description here on meta.

3 Likes

Excellent, I didn’t know that :+1:t2:

Thanks once again for the support!

2 Likes

Sorry @angus I think we’ve just found another bug which is preventing all members from setting or editing a location on their profile.

We are running discourse v2.5.0.beta4 +148 and have changed the Locations plugin to use https://github.com/paviliondev/discourse-locations.git which is also at the latest (5185063).

When people edit their profile they now see the standard Discourse location field:

Where before, they would have seen the Locations plugin field:

image

I’ve tried disabling the plugin from the Admin Settings, then re-enabling it again but that didn’t fix it I’m afraid.

1 Like

@angus and if it helps, this error is displayed in the browser console:

]

Which clicks through to:

image

1 Like

@Richie Thanks Richie. I’ve updated the plugin again to match the latest changes in Discourse (with an assist from @eviltrout).

I won’t be updating this again to keep up with changes in core Discourse until June 1, so if possible please hold on updating your site again till then. If this is an issue, let me know via PM and I can work something out with you.

We’re working on a few different things that will help with the problem of plugin compatibility with Discourse updates. Until we release those, we’re using a time-based approach of updating the plugin to the latest discourse in the first 5 days of every month.

4 Likes

Fantastic!

Thank you both @angus and @eviltrout this is excellent news.

Installed the update just now, everything is working beautifully again :blush:

Thanks once again guys, loving your dedication and support :+1:t2:

Understood :slight_smile:

3 Likes

Hi @angus I’m not sure what your update process consists of? Do you just check compatibility against whatever the current version of Discourse core is at the time of the checks?

1 Like