rugging24
rugging24

Reputation: 3

Deploying a custom cartridge on openshift online

I have been trying to add a PostgreSQL database to my OpenShift online account to no avail. I am a little confused about how to go about it and I thought I could ask for someone to point me to the right direction.

I have the source cloned from https://github.com/crunchyds/openshift-postgres-cartridge and uploaded to my openshift online repo. I tried running the included scripts - setup, control and the likes but get an error each time.

So I figured this is the wrong way to go about deploying it. Can anyone please explain how to go about it or post a link that would help ?

Here's the error message :

source /usr/lib/openshift/cartridge_sdk/bash/sdk
'[' false == true ']'
OO_BASH_SDK=true
echo /var/lib/openshift/54492b5d4382ec8e52000428//app-deployments
/var/lib/openshift/54492b5d4382ec8e52000428//app-deployments
tar xzf /versions/postgresql94.tar.gz
tar (child): /versions/postgresql94.tar.gz: Cannot open: No such file or 
directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
client_result 'Starting PostgreSQL server setup ...'
client_out CLIENT_RESULT 'Starting PostgreSQL server setup ...'
local type=CLIENT_RESULT
local 'output=Starting PostgreSQL server setup ...'
local 'IFS_BAK=     '
IFS=''
'[' -z 'Starting PostgreSQL server setup ...' ']'
for line in '$output'
echo 'CLIENT_RESULT: Starting PostgreSQL server setup ...'
CLIENT_RESULT: Starting PostgreSQL server setup ...
IFS=''
mkdir -p /var/lib/openshift/54492b5d4382ec8e52000428/app-
root/data//postgresql/9.4/data
mkdir -p /var/lib/openshift/54492b5d4382ec8e52000428/app-
root/data//postgresql/9.4/data/logs
echo 5432
./setup: line 22: /env/PGPORT: No such file or directory
echo /var/lib/openshift/54492b5d4382ec8e52000428/app-root/data//postgresql/9.4/data
./setup: line 23: /env/PGDATA: No such file or directory
echo /var/lib/openshift/54492b5d4382ec8e52000428/app-root/data//versions/postgresql94/bin
./setup: line 24: /env/OPENSHIFT_POSTGRESQL94_PATH_ELEMENT: No such file or directory
echo /versions/postgresql94/lib
./setup: line 25: /env/OPENSHIFT_POSTGRESQL94_LD_LIBRARY_PATH_ELEMENT: No such file or directory
echo /versions/bin
./setup: line 26: /env/OPENSHIFT_POSTGRESQL94_PATH_ELEMENT: No such file or directory
client_result 'Server setup completed successfully ...'
client_out CLIENT_RESULT 'Server setup completed successfully ...'
local type=CLIENT_RESULT
local 'output=Server setup completed successfully ...'
local 'IFS_BAK=     '
IFS=''
'[' -z 'Server setup completed successfully ...' ']'
for line in '$output'
echo 'CLIENT_RESULT: Server setup completed successfully ...'
CLIENT_RESULT: Server setup completed successfully ...
IFS=''

Upvotes: 0

Views: 543

Answers (3)

TheSteve0
TheSteve0

Reputation: 3526

When you add the cartridge you need to pass in the url for the cartridge.

Are you trying to run this in online?

If so I am not sure if this is supposed to work in online so I put in a Github issue for them to clarify.

If it is usable on online then the command to add the cartdidge would be like this command:

rhc cartridge add -a {your app name} http://reflector-getupcloud.getup.io/github/crunchyds/openshift-postgres-cartridge

Upvotes: 1

Stefan Mayr
Stefan Mayr

Reputation: 3

Multiple error messages reference a wrong working directory:

  1. tar: /versions/postgresql94.tar.gz: Cannot open: No such file or directory tar (child):
  2. /env/PGPORT: No such file or directory
  3. /env/PGDATA: No such file or directory
  4. /env/OPENSHIFT_POSTGRESQL94_PATH_ELEMENT
  5. /env/OPENSHIFT_POSTGRESQL94_LD_LIBRARY_PATH_ELEMENT
  6. /env/OPENSHIFT_POSTGRESQL94_PATH_ELEMENT: No such file or directory

Your $OPENSHIFT_PG_DIR seems to be "/" which looks wrong. According to the documentation this variable is built from the shortname in the manifest: OPENSHIFT_{Cartridge-Short-Name}_DIR . Have you changed the short name in the manifest file?

Upvotes: 0

Muffy
Muffy

Reputation: 421

You need to ensure that the official cartridges on OpenShift Online supports the version of PostgreSQL server. You don't necessary have to setup OpenShift Origin but might help you test your cartridges before using online.

Upvotes: 0

Related Questions