BobRay/UpgradeMODX

Upgrade MODX resource displays blank page

Closed this issue · 33 comments

Hi there, i installed the extra without issue, but the widget is not available and error messages are displayed instead. I have read on BobRays website that this can happen in older versions of MODX and to run the resource instead.

Unfortunately when viewed, the resource displays a blank page - it is trying to call the snippet upgradeMODX, which i don't believe has been installed - under the snippet folder 'UpgradeMODX', the only snippet that is listed is called 'upgradeMODXwidget'.

Further comments on BobRays page imply this may be down to the version of php and to edit some core files. but i am already using php5.4 Any ideas?

Any help gratefully received!

Hi Emily, Sorry for the trouble. I think it used to be called that before I converted it to a widget.

Try changing the name in the tag to upgradeMODXwidget.

Hi BobRay, thanks for responding. I did try that earlier today but unfortunately was given the same error message that i receive in place of the widget on the dashboard:

Error: (GitHub -- curl) API rate limit exceeded for 91.208.99.
Error: Failed JSON decode for version data from GitHub in upgradeAvailable()

Any other ideas?
Thanks for your help

That's the GitHub repo refusing to answer. I would try it again later (maybe right after midnight ;) ).

If you have a GitHub account (or are willing to create one), you can solve it permanently by getting a GitHub token.

Create a new Personal Token in your Github Account Settings (Dashbar -> Edit Profile. Sidebar: Personal Access Tokens) and copy it. Leave all the scopes unchecked. Click on Generate Token. Use any description you like. Be sure to copy it before you save the token.

Then, in the MODX Manager, go to Settings (gear icon) -> System Settings. Put GitHub in the search box at the upper right and press enter.

Set the values of the GitHub token and GitHub username (double-click on the values). Paste the token and enter your username. Then clear the site cache. You may have to manually delete the files in the core/cache directory before the changes take effect.

Hi BobRay,

Thanks again. Wow, i've been trying this since 9am this morning and its now 10pm and still get the same error! I will create a GitHub account tomorrow though and run through your instructions above. I will let you know. Many thanks for your help.

Does that mean as well that the Dashboard widget will work as well if i create a GitHub Token?

If there is a dashboard widget showing, it should.

On Wed, Apr 13, 2016 at 4:54 PM, emilygraham notifications@github.com
wrote:

Does that mean as well that the Dashboard widget will work as well if i
create a GitHub Token?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#17 (comment)

HI BobRay (and anyone else who may be able to help), i just tried to do an update using the dashboard widget (which displayed this morning!), but unfortunately despite all the checks coming back as OK, then displayed the following error

[code]Fatal error: Call to a member function get() on a non-object in /var/sites/f/domain.co.uk/public_html/core/model/modx/modrequest.class.php on line 192[/code]

Now, the frontend and backend display this error. I think i should have first upgraded to an earlier version and not straight from 2.2.14 to 2.4.0 but the oldest option available to me was 2.4.0. couple of questions then:
(1) Can you use the upgrademodx widget to upgrade in stages, i.e. to 2.3.0 and then 2.3.6 etc. and if so how do i do this
(2) How do i fix my existing website which is now showing a fatal error?
(3) Will i be able to upgrade at all or is there something more serious wrong?

Thanks everyone for your help

Just to give you an update to the above, i restored a previous database backup and followed the instructions in modxcms/revolution#12764 to add the field 'name' to the 'modx_context' table. I was then able to run setup again and get it all working. I did have a couple of issues along the way though with missing elements from the Manager and getlist processor errors, but these were fixed by running setup again, deleting cookies and upgrading all extras.

I have now upgraded to 2.4.0 and it all seems to be working as expected, though am concerned that perhaps i should have upgraded in stages to ensure that i have not missed any database changes(Advice?). I have checked for the extensions table which i believe was added in 2.3 and that is there. Is there a list somewhere of the database changes?

I now need to upgrade to 2.4.4 but the upgradeMODX dashboard widget is unable to connect to GitHub again. I have created a token in GitHub, but don't have any system settings called GitHub or GitHub Token, or anything related. Am i missing something?

As an alternative i changed the GitHub timeout to 16 seconds and the widget showed up straight away, taking me to the upgrade screen. i attempted to upgrade to 2.4.4 (And 2.4.3), but each time, on clicking upgrade i get a blank screen (URL: www.domain.co.uk/upgrade.php?modx=2.4.4-pl&userId=1). I now can't seem to be able to use the widget at all?

Thoughts and Ideas?
Many thanks for your time

Hi Emily,

You can use the widget to upgrade in stages. Just edit the settings_version
System Setting and change it to an earlier version (it doesn't have to be a
real version). That will make UGM think you have an older version. I would
recommend installing 2.3.0 and 2.4.0, then 2.4.4. The x.x.0 versions
contain changes that you don't want to skip over.

Sorry about the GitHub System Settings. I thought UGM installed them. You
can create them pretty easily. As long as the keys are github_username and
github_token, and the values are your username and token, the other fields
don't really matter.

On Thu, Apr 14, 2016 at 8:21 AM, emilygraham notifications@github.com
wrote:

Just to give you an update to the above, i restored a previous database
backup and followed the instructions in modxcms/revolution#12764
modxcms/revolution#12764 to add the field
'name' to the 'modx_context' table. I was then able to run setup again and
get it all working. I did have a couple of issues along the way though with
missing elements from the Manager and getlist processor errors, but these
were fixed by running setup again, deleting cookies and upgrading all
extras.

I have now upgraded to 2.4.0 and it all seems to be working as expected,
though am concerned that perhaps i should have upgraded in stages to ensure
that i have not missed any database changes(Advice?). I have checked for
the extensions table which i believe was added in 2.3 and that is there. Is
there a list somewhere of the database changes?

I now need to upgrade to 2.4.4 but the upgradeMODX dashboard widget is
unable to connect to GitHub again. I have created a token in GitHub, but
don't have any system settings called GitHub or GitHub Token, or anything
related. Am i missing something?

As an alternative i changed the GitHub timeout to 16 seconds and the
widget showed up straight away, taking me to the upgrade screen. i
attempted to upgrade to 2.4.4 (And 2.4.3), but each time, on clicking
upgrade i get a blank screen (URL:
www.domain.co.uk/upgrade.php?modx=2.4.4-pl&userId=1). I now can't seem to
be able to use the widget at all?

Thoughts and Ideas?
Many thanks for your time


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#17 (comment)

Jako commented

I have updated today a 2.2.x to 2.4.4 directly with UpgradeMODX without serious issues.

Earlier upgraders that skipped 2.3.0 and 2.4.0 ended up with no 'name'
field for contexts and no 'rank' field for categories in the DB. In fact, I
think the first one is what happened to Emily. Maybe that's fixed in 2.4.4.

On Thu, Apr 14, 2016 at 3:46 PM, Thomas Jakobi notifications@github.com
wrote:

I have updated today a 2.2.x to 2.4.4 directly with UpgradeMODX without
serious issues.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#17 (comment)

Its tough to know what to do isn't it! On one hand i have spent a lot of time upgrading from 2.2.14 to 2.4.0 and now everything is working, so do i start all over and do it in stages 2.2.14 - 2.3.0 - 2.4.0 and put the time in again, in the hope i can it upgraded again, or stick with what i have, on the basis that it is working and then just upgrade to 2.4.4................

If everything is working, the context table has a name field, and the
category table has a rank field, I'd say you're fine as is.
On Apr 15, 2016 6:21 AM, "emilygraham" notifications@github.com wrote:

Its tough to know what to do isn't it! On one hand i have spent a lot of
time upgrading from 2.2.14 to 2.4.0 and now everything is working, so do i
start all over and do it in stages 2.2.14 - 2.3.0 - 2.4.0 and put the time
in again, in the hope i can it upgraded again, or stick with what i have,
on the basis that it is working and then just upgrade to
2.4.4................


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#17 (comment)

I have the name field in the context table as i added it and the modx_categories table has a rank field (it has id, parent, category, rank), so that seems ok. I will stick with it and either trying manually upgrading to 2.4.4 tomorrow or use your modxUpgrade, depending on when it is released. Thanks for your help

I'm getting the same thing on a local install but not on others. Both resource and widget showing this error.

Error: Resolving timed out after 6516 milliseconds
Error: Failed JSON decode for version data from GitHub in upgradeAvailable()

I created the system settings as specified above but unfortunately doesn't seem to have helped. Is there anything I need to do to let UpgradeMODX know that the system settings are there?

Edit: Ah I see now it was meant to be snippet properties as opposed to system settings. Changed but unfortunately still not working. I'll experiment more and report back if I strike gold.

Are you on a slow internet connection? The UGM &githubTimeout property default is 6 seconds (6000 milliseconds), Try changing it to 10.

Thanks Bob, no it's not a slow connection.
I did as suggested but unfortunately it just took longer to time out.
Error: Resolving timed out after 10519 milliseconds
Error: Failed JSON decode for version data from GitHub in upgradeAvailable()

I'll try a fresh MODX install on the same machine as a way of isolating. Cheers.

That's weird. I'm suspecting that it's not really a timeout. Do you have an account at GitHub? If so, it could be some kind of issue with the GitHub credentials stored on your local machine.

I just tried UGM on my localhost install (I do have a GitHub account and stored credentials). It worked.

Hi sorry for the late reply. Yes I've been using it on other localhosts perfectly before now.
It's just this particular machine where it's occurring. I've tried with other MODX installs on the same host and the same thing. It doesn't matter if I use my Github credentials or not.
Could it perhaps be that Github has blacklisted the IP range I belong to?

I guess it's possible, but I think you'd get a quick rejection error message in that case rather than a timeout.

If you have Chrome, you can turn on dev. tools (ctrl-shift-i) and see the progress on the network tab. If you click on the URL, you may be able to see something useful on the response tab. You may also be able to see if the response is being forwarded or going through a proxy.

watou commented

Hi Bob, just another report that the steps taken above did not help resolve the GitHub timeout trying to use UGM on MODX 2.3.3_pl on a shared hosting production server. Just FYI. But thanks for this addon IAC.

Have you tried UGM version 1.5.4? It has some changes that might help with this.

Jako commented

1.5.4 shows the same issue on one host here.

Jako, have you looked at the process in Chrome Dev. Tools to see if there are any clues? You can click on a line and see the request and the response.

Jako commented

Sorry, I posted on the wrong thread, since I just faced the (GitHub -- curl) API rate limit exceeded message, which was mentioned above.

It would be nice, if the version check could be handled without a system setting based GitHub token and username.

I agree. I was told that there would be a SOAP server for extras at modx.com so it could all be handled much more easily without involving GitHub, but that was a year or two ago and I haven't heard anything more about it.

Jako commented

You could maybe ask @wuuti which service he uses for Updater.

I haven't looked at Updater lately, but IIRC, the last time I checked the versions were hard-coded into the script.

I considered scraping the latest version from modx.com/downloads, but that would preclude giving the user the option of several versions.

Updated to the latest MODX Revolution 2.6.5
there was still issue with unability to load these files during upgrade:

  • core/components/upgrademodx/cacert.pem
  • core/components/upgrademodx/model/upgrademodx.class.php

after downloading and then adding them into their missed places the upgrade was successful,
but the issue with errors showing up in widget area still persist. Here is what it shows in my case:

Error: (GitHub -- curl) API rate limit exceeded for 81.169.144
Error: ugm_no_version_list_from_github

You need to get an API key from GitHub and set that and your GitHub username in the snippet properties.
See the "GitHub API Rate Limit Exceeded" section here: https://bobsguides.com/upgrade-modx-package.html

One of the websites I installed this on only gives me a blank page (using the resource) and the widget doesn't show up on the dashboard. There are no errors in the log, nothing in the browser console, I tried using the GitHub api key to no effect. It works fine on other sites on the same server so it must be something with this site. I manually upgraded MODX to 2.7 hoping that would help but nothing. I switched the site to PHP 7.2 hoping it was something on the install but no change. I know it should at least be showing the template but it isn't even doing that. I am completely flummoxed.

Go to System (gear icon) -> Dashboards and make sure the UGM Widget is on your default dashboard. If not, add it. If you installed UGM on a pre-widget version, the widget would not be attached to any dashboard.

I'm going to close this. It contains too many different issues and applies to previous versions of UGM.

If you experience a new issue with the latest version. Please start a new issue.