OpenShift Play Application Deployment - openshift

I just followed the steps as mentioned in the following Github repo to deploy a Play application to OpshShift:
https://github.com/opensas/play2-openshift-quickstart
When I tried uploading my sources to OpenShift, I get the following error:
remote: Stopping DIY cartridge
remote: Building git ref 'master', commit 54b44ff
remote: Preparing build for deployment
remote: Deployment id is 9379deb4
remote: Activating deployment
remote: Starting DIY cartridge
remote: chmod: cannot access `/var/lib/openshift/XXXXXXXXXX/app-root/runtime/repo/target/start': No such file or directory
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
Why is there no target/start directory? Any ideas?

The stage task have been rewritten in Play 2.2:
https://www.playframework.com/documentation/2.2.0/Migration22 (Preparing a distribution)
Instead of mentioned repo please use this one:
https://github.com/JamesSullivan/play2-openshift-quickstart

If you're using play framework 2.2+, you'll have to change your openshift APP_COMMAND to start from target/universal/bin/{your-app-name} instead of target/start.
You can modify this in the .openshift/action_hooks/start file.

Related

Not able to change <title> tag without error heroku

OK this might be user error but whenever I try to change the title tag on my Heroku website I get an application error. I followed the tutorial on the Heroku website to make a node.js website that commits to GitHub which then serves to heroku. All I did was change the title tag in the header.ejs file and now when I open my page I get an application error. Here's what the output is in my console when I push to Heroku
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 482 bytes | 482.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.x
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.16.3...
remote: Using default npm version: 6.14.4
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > ejs#2.7.4 postinstall /tmp/build_c695ccb72d0772c3b509ad9fd8557d1d/node_modules/ejs
remote: > node ./postinstall.js
remote:
remote: added 145 packages in 3.217s
remote:
remote: -----> Build
remote:
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Pruning devDependencies
remote: removed 84 packages and audited 139 packages in 1.734s
remote: found 0 vulnerabilities
remote:
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 23.7M
remote: -----> Launching...
remote: Released v22
remote: https://flamegames.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/flamegames.git
302eafd..030aebf master -> master

remote: npm notice created a lockfile as package-lock.json. You should commit this file

This is the same question:
npm notice created a lockfile as package-lock.json. You should commit this file
But the answer did not work when trying to push an update with this code:
Js-Mac:Evennode server j$ git add -A
Js-Mac:Evennode server j$ git commit -m "asdd"
[master a1e7bc0] asdd
1 file changed, 1 insertion(+), 1 deletion(-)
Js-Mac:Evennode server j$ git push -u origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 275 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Downloading app
remote: ---> Downloading cache
remote: ---> Restoring cached modules
remote: Loading cached modules
remote: - node_modules (skipping - exists)
remote: - bower_components (skipping - not in cache)
remote: ---> Installing modules
remote: npm notice created a lockfile as package-lock.json. You should commit this file.
remote: npm WARN server#1.0.0 No description
remote:
remote: up to date in 0.32s
remote: ---> Building app image
remote: ---> Uploading app image
remote: ---> Restarting app
remote:
remote:
remote: *************************************
remote: * APP SUCCESSFULLY DEPLOYED *
remote: *************************************
remote:
remote:
To git.evennode.com:c2c3efd78df9974631320f4ce68e7b7d.git
fd5f549..a1e7bc0 master -> master
Branch master set up to track remote branch master from origin.
It says commit this file, but the file is nowhere on my Mac. What can I do to remove this error?

Heroku Toolbelt fails to detect a set buildpack

I have tried manually clearing and setting the buildpack for my Rails app to heroku/rails. I have verified that I have a Gemfile, and I still get this error
remote: -----> Using set buildpack heroku/ruby
remote:
remote: ! Push rejected, failed to detect set buildpack heroku/ruby
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected
Which is confusing since I set the buildpack but then it can't detect it. Some of my routes are rendering json as I wanted this app to serve as a backend API. Do I need to add a buildpack for Node? Any other suggestions?
I had the app located within a redundant subfolder in the git repo. I fixed the problem by moving everything up a level, recommitting, and git push heroku master. Heroku was looking for a Gemfile in the top level, so I moved all the application files to the top level (where it should have been all along).
I reinitialized the repo and did it again. Did my commits and pushed. Worked!!!
git init
add heroku as a remote
git remote add heroku https://git.heroku.com/appname.git'
git add .
git commit -m "initial commit"
git push heroku master

Openshift pre_start and post_start hook infinite loop

Hi!
I've too hooks, one for pre_start and one for post_start.
pre_start start a self written script like: nohup python foo.py > /dev/null &
Where foo.py runs continously doing stuff as usual.
post_start is just for diagnosing that everything runs fine, it just calls ps aux and sends an e-mail about it. (It's a Python script with a shebang)
Now. As I commit and push something the rebuild starts and it ends up with an infinite loop between the two pre_start and post_start scripts :(
Just some little messages are between them, which I do not understand:
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
Thanks for any help! :)
As I see, it's normal. As many cartridges you have so many times will your hooks be called. In my fall 4 times... I had to handle this, with renaming my hooks with a postfix python-2.7 so: pre_start_python-2.7. This way it yould be run only once.
Here is the event log of the deploy process:
remote: Preparing build for deployment
remote: Deployment id is 4e9628aa
remote: Activating deployment
remote: pre_start called
remote: Starting Cron cartridge
remote: post_start called
remote: pre_start called
remote: Starting MongoDB cartridge
remote: Waiting for mongo to start...
remote: post_start called
remote: pre_start called
remote: Starting RockMongo cartridge
remote: post_start called
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.fish cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: Script /var/lib/openshift/5...3/python//virtenv/bin/activate.csh cannot be made relative (it's not a normal script that starts with #!/var/lib/openshift/5...3/python/virtenv/bin/python)
remote: pre_start called
remote: Starting Python 2.7 cartridge (Apache+mod_wsgi)
remote: Application directory "/" selected as DocumentRoot
remote: Application "wsgi.py" selected as default WSGI entry point
remote: post_start called
remote: -------------------------
remote: Git Post-Receive Result: success

Pushing to bitbucket: authorization failed

I'm a git & github user that's new to mercurial & bitbucket and I'm trying to use bitbucket for a project.
So far I've got write access to a new private bitbucket repository, and I got started by:
cloning
adding my existing project
committing
trying push, I get authorization failed via:
HTTPS
$ hg push https://mariusbutuc#bitbucket.org/DB2UAdmin/repo
http authorization required
realm: Bitbucket.org HTTP
user: mariusbutuc
password:
pushing to https://mariusbutuc#bitbucket.org/DB2UAdmin/repo
searching for changes
abort: authorization failed
SSH
$ hg push ssh://hg#bitbucket.org/DB2UAdmin/repo
pushing to ssh://hg#bitbucket.org/DB2UAdmin/repo
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 9664 changes to 9664 files
remote: You're not allowed to write to this repository.
remote: transaction abort!
remote: rollback completed
remote: abort: pretxnchangegroup.bb_perm hook failed
also attempted via simple HTTP, got similar results as with HTTPS.
How can I get it to work?
Extra details:
python 2.7.1+
mercurial 1.7.5
on Ubuntu 11.04
The bitbucket account was opened under my gmail address [addr A].
The SSH key was made using the address from my company [addr B].
addr B was added to my account as a secondary address.
I had writing access for the mariusbutuc account, that had both addresses.
...I still couldn't pass the auth test.
Got an invitation form the Admin, on my work address - addr B. With admin rights, not only write.
Trying to accept the invitation, I couldn't: my account already had access to the repository.
Had to revoke my own access, just to be able to
accept the admin rights.
Pushed successfully via SSH:
$ hg push ssh://hg#bitbucket.org/DB2UAdmin/repo
pushing to ssh://hg#bitbucket.org/DB2UAdmin/repo
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 9664 changes to 9664 files
remote: bb/acl: mariusbutuc is allowed. accepted payload.
I still have no idea why pushing via HTTPS [username/password] failed!
For those of you that arrive here from googling "pretxnchangegroup.bb_perm hook failed" this can be caused by trying to merge to a branch that you do not have the "write" permission under "branch permissions" on bitbucket.
Presumably this is because you should have used a pull request for the merge rather than going ahead and merging on your local.