Deploying a custom cartridge on openshift online - postgresql

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=''

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

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.

Multiple error messages reference a wrong working directory:
tar: /versions/postgresql94.tar.gz: Cannot open: No such file or directory tar (child):
/env/PGPORT: No such file or directory
/env/PGDATA: No such file or directory
/env/OPENSHIFT_POSTGRESQL94_PATH_ELEMENT
/env/OPENSHIFT_POSTGRESQL94_LD_LIBRARY_PATH_ELEMENT
/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?

Related

Running druid script for injestion spec failed - bin/post-index-task --file quickstart/tutorial/wikipedia-index.json

I am trying to follow the quickstart for running the script but it is failing with this error in druid router cli:
~ $ bin/post-index-task --file quickstart/tutorial/wikipedia-index.json
bin/post-index-task: /opt/druid/bin/post-index-task-main: /usr/bin/env: bad interpreter: No such file or directory
bin/post-index-task: line 31: /opt/druid/bin/post-index-task-main: No error information
bin/post-index-task is already present but it seem to throw an error of No such file or directory.
Please guide, thanks.

Unable to start bitbake server

I am trying to learn yocto by following the video tutorials on their main website. I installed the poky-rocko-18.0.0 and after setting up the build environment I tried to build the linux image using the following command:
bitbake core-image-minimal
However, I am getting the following error:
I am unsure how to start the bitbake server and so far have not found any good references for the same.
We also faced same issue with our bitbake server. It will worked after remove bitbacke.lock
file. Use below command for solution.
rm -rf bitbake.lock
###/build$ bitbake core-image-sato
Loading cache: 100% |#########################################################################################################################################################################################################| Time: 0:00:01
Loaded 3867 entries from dependency cache.
Parsing recipes: 100%
My problem was some missing packages on my build system.
Fixed it by installing the following packages (Debian):
sudo apt-get install chrpath
sudo apt-get install texinfo
On my Arch system:
sudo pacman -S rpcsvc-proto chrpath texinfo cpio diffstat
Just try this in your build folder:
rm -rf bitbake.lock
this shoud work
The reason for this is the state of the bitbake is locked during last bitbake execution. Once you stop intermittently, we need to remove the bitbake.lock
In my case it was solved with this answer from https://stackoverflow.com/a/45880855/5350353 (Unable to connect to bitbake server):
This is because new function findTopdir (Submitted on July 18, 2017) does not handle errors. For example, the lack of BBPATH environment variable and the inability to find conf/bblayers.conf in BBPATH. findTopdir just returns None in case of that errors.
Maybe caused by the absence of host application(s), like gawk, chrpath and texinfo.
Below is one example.
ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/zephyr/workspace/w031/openembedded-core/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 22675 at 2019-03-16 00:28:44.447008 ---
Traceback (most recent call last):
File "/home/zephyr/workspace/w031/bitbake/lib/bb/cookerdata.py", line 290, in parseBaseConfiguration
bb.event.fire(bb.event.ConfigParsed(), self.data)
File "/home/zephyr/workspace/w031/bitbake/lib/bb/event.py", line 225, in fire
fire_class_handlers(event, d)
File "/home/zephyr/workspace/w031/bitbake/lib/bb/event.py", line 134, in fire_class_handlers
execute_handler(name, handler, event, d)
File "/home/zephyr/workspace/w031/bitbake/lib/bb/event.py", line 106, in execute_handler
ret = handler(event)
File "/home/zephyr/workspace/w031/openembedded-core/meta/classes/base.bbclass", line 238, in base_eventhandler
setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d)
File "/home/zephyr/workspace/w031/openembedded-core/meta/classes/base.bbclass", line 142, in setup_hosttools_dir
bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % " ".join(notfound))
File "/home/zephyr/workspace/w031/bitbake/lib/bb/__init__.py", line 120, in fatal
raise BBHandledException()
bb.BBHandledException
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zephyr/workspace/w031/bitbake/lib/bb/daemonize.py", line 83, in createDaemon
function()
File "/home/zephyr/workspace/w031/bitbake/lib/bb/server/process.py", line 469, in _startServer
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
File "/home/zephyr/workspace/w031/bitbake/lib/bb/cooker.py", line 210, in __init__
self.initConfigurationData()
File "/home/zephyr/workspace/w031/bitbake/lib/bb/cooker.py", line 375, in initConfigurationData
self.databuilder.parseBaseConfiguration()
File "/home/zephyr/workspace/w031/bitbake/lib/bb/cookerdata.py", line 317, in parseBaseConfiguration
raise bb.BBHandledException
bb.BBHandledException
ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
gawk
First, change local.conf, bblayers.conf to previous configuration.
Then, bitbake -c cleanall recipe_name.
It will be all right now!
Like the OP stated a package was missing on the build host. ( makeinfo in his case)
To properly prepare the build host, look into the documentation for your yocto version and your Distro.
latest
In my case some playing with devtool caused a duplicated definition in bblayers.conf:
BBLAYERS ?= " \
${TOPDIR}/../meta \
${TOPDIR}/../meta-poky \
${TOPDIR}/../meta-yocto-bsp \
${TOPDIR}/../meta-atmel \
${TOPDIR}/../meta-libgpiod \
${TOPDIR}/../meta-libuio \
${TOPDIR}/../meta-lsuio \
${TOPDIR}/workspace \
/home/me/yocto/poky/build/workspace \
"
I had to manually remove one of the two last lines as follows:
BBLAYERS ?= " \
${TOPDIR}/../meta \
${TOPDIR}/../meta-poky \
${TOPDIR}/../meta-yocto-bsp \
${TOPDIR}/../meta-atmel \
${TOPDIR}/../meta-libgpiod \
${TOPDIR}/../meta-libuio \
${TOPDIR}/../meta-lsuio \
${TOPDIR}/workspace
"
Then I retried and the issue was resolved.
In my case (PLNX 2018.2) I was not getting this problem because of the .Xil folder that was hidden in the root directory of the project, deleting it solves the problem.
I had a similar issue; with an additional Unicode Decode Error: 'ascii' codec can't decode byte 0xe2 in position 5305: ordinal not in range(128) at the bottom of the list.
I resolved this by checking my 'locale' setting in Ubuntu 18.04. and running the following:
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
bitbake-layers command worked perfectly after this.
Please shutdown and rerun that bitbake command then it will solve.

Odoo 500 server internal error after installation of odoo

Hı all. Thank you for this community. I want use odoo for my job. but I'm so tired, I'm on the verge of giving up from odoo.
I would be very grateful if you help.
After installation, I can get once localhost8069 . And creating database.
ANd ı take create database error.
Database creation error: "invalid byte sequence for encoding "UTF8": 0xff " while parsing /usr/lib/python2.7/dist-packages/openerp/addons/base/base_data.xml:55, near <span>--<br/> Administrator</span>
After this error ı take always 500 internal server error. I can not see login interface anymore. I just see 500 internal server error.
6 days I'm working and I could not reach a solution. I used ubuntu and pardus ( some kind debian) . And the results did not change.
But when ı used w7 ı succeed. I was able to get odoo. But ı want use odoo in linux not windows.
I guess this error about database. But ı didnt find source about confıgure postgresql for odoo. Can you help me pls ?
This is my steps for installions of odoo after fresh ubuntu :
1-)
wget -O - nightly.odoo.com/odoo.key | apt-key add -
echo "deb nightly.odoo.com/9.0/nightly/deb/ ./" >> /etc/apt/sources.list
apt-get update && apt-get install odoo
2-) and go : http://localhost:8069
Log file : ı erased log file and restart odoo server and try few time localhost:8069 again :
And this is end of new fresh log file :
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1554, in setup_db
httprequest.session.db = db_monodb(httprequest)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1701, in db_monodb
dbs = db_list(True, httprequest)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1675, in db_list
dbs = openerp.service.db.list_dbs(force)
File "/usr/lib/python2.7/dist-packages/openerp/service/db.py", line 323, in list_dbs
with closing(db.cursor()) as cr:
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 630, in cursor
return Cursor(self.pool, self.dbname, self.dsn, serialized=serialized)
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 164, in __init
self._cnx = pool.borrow(dsn)
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 513, in _locked
return fun(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 581, in borrow
**connection_info)
File "/usr/lib/python2.7/dist-packages/psycopg2/init.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: fe_sendauth: no password supplied
Let's try with the first solution:
Make sure the permission is correct for postgres engine by giving the correct one as the following:
sudo chown -R postgres:postgres /var/run/postgresql (default directory)
Plus, make sure the port 8069 is open.
I finally found a solution. The problem is very simple. This problem is caused by using debian, which is not English. The English debian worked without error.
As a result, we always use the operating system in English.
try this command: ps -A
check for postgresql & odoo proccess and kill them all
do it for few times
if you are using VMware like me restart it
hope that answer your question

PHP Fatal error: Class 'Phar' not found in

When I deploy my commits via Git to the server, it runs a git hook that has the line
test -f composer.phar && ./composer.phar self-update || curl -s http://getcomposer.org/installer | php;
That generates the error:
PHP Fatal error: Class 'Phar' not found in .../composer.phar on line 23
This is line 23 from composer.phar:
Phar::mapPhar('composer.phar');
I did search other questions with the same problem and checked these things:
git hook's script already has permission to be executed
I can execute ./composer.phar without error when logged in server and inside the same folder as set in the git hook's script
PHP modules has Phar enabled, checked via php -m
There is no extension=phar.so in php.ini, but I dont think it has to be because it's already enabled
PHP version: PHP 5.5.3 (cli)
What else could be causing this?

How to set node path for nodejs (Ubuntu)

I'm trying to setup nodejs to access a postgres database. What I've done so far is the following (https://gist.github.com/579814):
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
then
git clone git://github.com/isaacs/npm.git
make
make install
so far, so good. However, when I try to install the postgres driver
npm install pg
I get the following:
node-waf configure build || true
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for program pg_config : /usr/bin/pg_config
'configure' finished successfully (0.066s)
Waf: Entering directory `/home/christian/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/default/src/binding_1.o
../src/binding.cc:3:25: fatal error: node_events.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/christian/node_modules/pg/build'
Build failed: -> task failed (err #1):
{task: cxx binding.cc -> binding_1.o}
I've been looking around for setting the node path, although haven't found anything of help so far - probably also because I'm totally new to nodejs, so I'd be happy about any hint.
Now, you have NodeJS installed in your Ubuntu. You should set /etc/environment and load nodeJS path that can be executed by another users. For example:
NODE="/home/ubuntu/local/node"
NODE_PATH="/usr/local/lib/node_modules"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$NODE/bin:$NODE/lib/node_modules"
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Do this in bash:
echo 'export NODE_PATH=~/local/:~/local/node_modules' >> ~/.bashrc
before things are fixed you must use node 0.5.1 (you can use gitk to revert the tree to this version)
Auteur: Ryan Dahl <ry#tinyclouds.org> 2011-07-19 10:46:38
Auteur du commit: Ryan Dahl <ry#tinyclouds.org> 2011-07-19 10:46:38
Parent: 0a3fc1d9c8becc32c63ae736ca2b3719a3d03c5b (Remove StatWatcher's dep on C++ EventEmitter)
Enfant: 061ce7b0ac370c8a5ae93d95ab7da171cbd488f0 (net_uv: Fix simple/test-http-expect-continue.js)
Branche: master, remotes/origin/master
Suit: v0.5.1
Précède: v0.5.2
Finally remove node::EventEmitter
I had the same problem.
The issue was that I was specifying a old version of PG in my package.js
After I removed the old version dependancy I was able to install PG without issue.