Upgrade discourse-backups-to-dropbox


#1

Anyone can help me please with this plugin :slight_smile:


(cpradio) #2

Your screenshot doesn’t provide enough information. Can you either scroll up or provide more of the log? Or can you provide what plugins you have installed?


#3

the plugin is “discourse-backups-to-dropbox”, and yes i will scroll up


(Alberto Aguirre) #4

Are you getting this?

NameError: uninitialized constant DiscourseBackupToDropbox::Synchronizer
/var/www/discourse/plugins/discourse-backups-to-dropbox/lib/dropbox_synchronizer.rb:2:in <module:DiscourseBackupToDropbox>' /var/www/discourse/plugins/discourse-backups-to-dropbox/lib/dropbox_synchronizer.rb:1:in<top (required)>’

It seems the plugin expects GitHub - berlindiamonds/discourse-sync-base: this is a basic Discourse plugin to build synchronizers for backups to be loaded first. I have this on my app.yml but discourse-backups-to-dropbox depends on discourse-sync-base - is there a way to enforce loading order?

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/berlindiamonds/discourse-sync-base.git
          - git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git

(Alberto Aguirre) #5

There’s more discussion here:


(Jay Pfaffman) #6

I suspect that this is going to confuse many people installing the plugin, and those who installed it long ago will have little way to guess at this solution. I understand the benefit of all of these plugins pulling from a single code base, but is there a way that they can do it themselves?


(Jen) #7

They load alphabetically, if you change the name of the discourse-backups-to-dropbox folder to something like discourse-sync-to-dropbox (this is the name convention the other backup plugins follow) it will inherit from the sync-base and the issue will be solved.
@Falco , the plugin needs to be renamed because of this issue with the loading order :slight_smile:


(Alberto Aguirre) #8

Oh ok. Seems a bit fragile, but I guess that’s the only way to specify an order.

This works for me (on app.yml)

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/berlindiamonds/discourse-sync-base.git
          - git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git discourse-sync-to-dropbox

Discourse rebuild failed from 1.9.0.beta5 to 1.9.0.beta6
Discourse Backups to Dropbox (Deprecated)
#9

I have broken my forum with those upgrade: discourse + plugin
It’s the same error message when i want to upgrade discourse.

I restored my website, i will check an other day for upgrading the plugins and my website…
Thank you for your answers my brothers :slight_smile:

Edit: Discourse Backups to Dropbox (Deprecated)


(Jay Pfaffman) #10

Wha? That’s much, much worse than I thought, but explains why the build I just tried failed. I don’t understand, though, how it ever worked enough to be committed.


#11

thanks a lot, all is work good now, i used your app config file @Jen_Lijo


(James North) #12

This doesn’t work for me …

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-data-explorer.git
          - git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git
          - git clone https://github.com/xfalcox/discourse-signatures.git

Have I missed something glaring? :slight_smile:


#13

yes @JamesNorth

 - git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git discourse-sync-to-dropbox

(James North) #14

Ugh, didn’t see that the window scrolled to the right :wink:

Cheers, @NotAfk


(James North) #15

I just tried doing a new rebuild with this

- git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git discourse-sync-to-dropbox

And it’s obviously using that code because it’s putting it into the new folder, but I still get the build error.


gem install http_parser.rb -v 0.6.0 -i /var/www/discourse/plugins/discourse-sync-to-dropbox/gems/2.3.4 --no-document --ignore-dependencies
Building native extensions.  This could take a while...
Successfully installed http_parser.rb-0.6.0
1 gem installed
gem install http-cookie -v 1.0.3 -i /var/www/discourse/plugins/discourse-sync-to-dropbox/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed http-cookie-1.0.3
1 gem installed
gem install http-form_data -v 1.0.1 -i /var/www/discourse/plugins/discourse-sync-to-dropbox/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed http-form_data-1.0.1
1 gem installed
gem install http -v 2.0.3 -i /var/www/discourse/plugins/discourse-sync-to-dropbox/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed http-2.0.3
1 gem installed
gem install dropbox-sdk-v2 -v 0.0.3 -i /var/www/discourse/plugins/discourse-sync-to-dropbox/gems/2.3.4 --no-document --ignore-dependencies
Successfully installed dropbox-sdk-v2-0.0.3
1 gem installed

I, [2017-08-19T10:22:42.513566 #13]  INFO -- : Terminating async processes
I, [2017-08-19T10:22:42.513711 #13]  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/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 42
I, [2017-08-19T10:22:42.514262 #13]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 155
2017-08-19 10:22:42.514 UTC [42] LOG:  received fast shutdown request
2017-08-19 10:22:42.514 UTC [42] LOG:  aborting any active transactions
2017-08-19 10:22:42.516 UTC [49] LOG:  autovacuum launcher shutting down
2017-08-19 10:22:42.519 UTC [46] LOG:  shutting down
155:signal-handler (1503138162) Received SIGTERM scheduling shutdown...
2017-08-19 10:22:42.556 UTC [46] LOG:  database system is shut down
155:M 19 Aug 10:22:42.593 # User requested shutdown...
155:M 19 Aug 10:22:42.594 * Saving the final RDB snapshot before exiting.
155:M 19 Aug 10:22:42.656 * DB saved on disk
155:M 19 Aug 10:22:42.657 # 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 413 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}

If I remove the Dropbox plugin from the app.yml file, it works fine.


#16

why you don’t want to use the same structure like this ? it’s work for me

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-adplugin.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/berlindiamonds/discourse-sync-base.git
          - git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git discourse-sync-to-dropbox

you can’t put only the git link of discourse backup dropbox, you need to put also the git link of discourse sync.
discourse. The plugin discourse-backups-to-dropbox depends on discourse-sync-base.
And use the same order :slight_smile:


(James North) #17

I didn’t realise that the standalone plugin now requires the other plugin to work - is that the case?

I’ll try this out and report back.


(James North) #18

This works for me, and only in this exact order with this alternative local folder listed at the end of the second source.

- git clone https://github.com/berlindiamonds/discourse-sync-base.git
- git clone https://github.com/xfalcox/discourse-backups-to-dropbox.git discourse-sync-to-dropbox

Thanks @NotAfk!


(kaja santro) #19

Yes, that is the case. In order to standardize the plugin structure for backup plugins, we built one base class for all synchronizers that any other plugin with a backup provider can hook into. So the dropbox plugin uses the same synchronizer class as the google drive plugin, the box plugin and the nextcloud plugin.
You can think of the discourse-sync-base as a mother plugin and all the discourse-sync-to-[provider] plugins as daughters of the sync-base. I am sure, @Falco will fix the name soon so that they are loaded in the right order.


(Jeff Atwood) #20

Unlikely as he is dedicated to a mission critical project for us for the next 2 months. I don’t know who else can do it at this time. Loading in alphabetical order is leading to a lot of support issues.