Smallest-Federated-Wiki icon indicating copy to clipboard operation
Smallest-Federated-Wiki copied to clipboard

(Re)installation on OpenShift has errors

Open coevolving opened this issue 10 years ago • 10 comments

I was having problems first with claiming and then logging into the fed wiki that I had installed last Sunday (in Iowa), so I decided (this Wednesday in Yorkshire) to just do a reinstallation, since I wanted a CNAME from a different domain.

On the IRC, I was getting some coaching from @almereyda, but the installation wouldn't complete without error messages. I reran the installation, and then decided to script the terminal for debugging purposes. I have cached a transcript at http://coevolving.com/transfer/20140528_openshift/ .

I didn't have any problems on Sunday, following https://github.com/paul90/wiki-openshift-quickstart and the Getting Started with OpenShift ebook at https://www.openshift.com/promotions/ebook .

coevolving avatar May 28 '14 22:05 coevolving

I believe, from a number of comments in support, this problem is caused by OpenShift using an old version of npm. Though it does appear to be intermittent, or maybe the gears are hosted on different machines!? I currently have one gear that installs without a problem, and another that doesn't.

The quick solution is to use npm shrinkwrap, see https://gist.github.com/paul90/5a6a02e1151055a2580a. Just add this into the root of the repo, commit and push up to your gear.

The longer term solution is either to add the shrinkwrap file, to go back to building a more up to date version of node (or just npm) in the gear, or see what happens to the request to update the version of node on OpenShift.

paul90 avatar May 29 '14 05:05 paul90

It might be an idea to add your vote to https://www.openshift.com/content/please-update-npm-version as this represents the best solution.

paul90 avatar May 29 '14 05:05 paul90

@paul90 Thanks for the diagnosis.

I'm really a complete Github newbie, so when you say "Just add this into the root of the repo, commit and push up to your gear", I'll have to learn a little more to parse each of those three steps.

Today, I'm on a train and then in a conference for two days. I will try to time-slice in some learning and give this a tryo.

coevolving avatar May 29 '14 06:05 coevolving

The OpenShift quickstart now includes the shrinkwrap file, so the above steps no longer need to be taken.

paul90 avatar Jun 01 '14 13:06 paul90

Not sure the shrinkwrap is the answer, just doing some testing and it fail installing glob - needing a later version of npm, or probably more correctly semver.

Looks as if we will need to build a later version of node as part of the gear - not ideal.

paul90 avatar Jun 02 '14 11:06 paul90

I have reverted to building the wiki OpenShift quickstart off the custom node version project.

This is now over at https://github.com/paul90/wiki-openshift-quickstart - as v0.2.5 - which uses node.js 0.10.28 and includes configuration to enable farm mode (off by default).

I have deleted the gist mentioned above, as it is no longer required.

paul90 avatar Jun 02 '14 17:06 paul90

@paul90 I followed the instructions at https://github.com/paul90/wiki-openshift-quickstart/blob/master/README.md , and everything successfully installed at http://fed-coevolving.rhcloud.com. I then claimed the site with my Gmail address there.

(1) I set up the CNAME from coevolving.com and the alias on Openshift for http://fed.coevolving.com/ . When I try to "Sign in with your Email" with the same Gmail address that did the claim above, I get a message "Login Failure. It looks as if you are accessing the site using an alternative address. Please check that you are using the correct address to access this site."

Does this mean that (a) I should use http://fed-coevolving.rhcloud.com for editing and direct readers to http://fed.coevolving.com/ , or (b) I shouldn't do the claim until after the CNAME and alias are set up? My read is that option (b) ensures greater portability, should I decide to move off OpenShift some day.

(2) Following through the instructions to "Updating the Federated Wiki modules" doesn't seem to set the marker:
-- begin paste -- $ touch .openshift/marker/update touch: cannot touch `.openshift/marker/update': No such file or directory -- end paste -- Is this something that only works after there's a change in the upstream repo, or am I doing something wrong? (Yes, I'm still a Git newbie).

I apologize for the slow implementation of your speedy and diligent updates. After stops to Oxford-Nottingham-Coventry-Stratford-upon-Avon, I'm back home in Toronto with a stable Internet connection.

coevolving avatar Jun 04 '14 12:06 coevolving

@coevolving,

(1) In normal mode, self.url = "http://" + process.env.OPENSHIFT_APP_DNS; is used as the return address from the Persona login. This will only be correct if you are not using aliases. So, in your case accessing the site as http://fed-coevolving.rhcloud.com.

There are three possible solutions, either: -

  1. (a) above - which is not idea, or
  2. edit server.js so that self.url = 'http://fed.coevolving.com', or
  3. use farm mode, this will make fed.coevolving.com and fed-coevolving.rhcloud.com two sites - though content, or code, could be added to redirect people to the former from the later this would probably be a useful feature to add N.B. each site has its own data sub-directory so you will need to move any content to fed.coevolving.com's sub-directory (pages and status).

(2). Strange, this is in the home directory of the repo you push up to OpenShift? Alternatively just create the file, using a texteditor. I tend to put the date in the file, just so I can see at a glance when I last performed an update.

And, I still have to reflect Nick's changes into the OpenShift version, while this will alter server.js to bring in the changes that were made in fedwiki/wiki-node

paul90 avatar Jun 04 '14 14:06 paul90

@paul90 Thanks for the clarifications. I have followed these, and everything seems to now work.

(1) To resolve the alias issue, I edited server.js to hard-code self.url. I first thought I might try farm mode, but then reverted because I don't understand all of the configurations required there yet. I'll work on content for a while, and implement farm mode on a different domain, later.

(2) In looking beyond copy-and-pasting, I figured out that the instructions read: touch .openshift/marker/update ... where they should read ... touch .openshift/markers/update

This is a good way for me to be learning what's really happening with Git. It's easier to modify your instructions than for me to try to figure out from scratch. This interactions has been very helpful.

coevolving avatar Jun 04 '14 20:06 coevolving

I've clarified some instructions for novices less familiar with OpenShift and Git at http://fed.coevolving.com/view/wiki-openshift-quickstart. (Since I was doing this again, I had to refresh my own memory!)

coevolving avatar Jun 24 '14 19:06 coevolving