binding couldbees-hosted database to Play app - cloudbees

Does it work for anyone? I used
bees app:bind
command and although it bound the app and db, (as shown by bees app:bindings) it did not show any db credential variables it created (neither I could just use them in application.config).
I tried setting those credential variables via
bees config:set
but running the app via
play run
still threw a dereferencing error.
Thanks!

Sure it work, we use it on this app
see the db.* properties on conf file

Related

why artisan command not clearing cache in laravel

I have written the logic to get the user-name of registered users from DB and used it as URL prefix in my web.php and grouped some routes using those name.
On my local machine it seems to working fine. In case of server users can register, but that user is not able to access the further routes with their username as prefix. When tried to access it shows 404.
When did the research it was due to routes not getting cleared. So, after new user registration successfully added the below code to clear cache and route. but still not working. How can i achieve this.
Added on top;
use Illuminate\Support\Facades\Artisan;
Artisan::call('route:clear');
Artisan::call('cache:clear');
I have tried clearing cache manually it works fine. But i am trying to do it via code automatically. Also FYI i am not getting any error. because i have tried adding logs and used
Artisan::output()
to check it, shows success message without any error
I am not sure if you can call the default laravel artisan commands via that facade. What I am sure is that if you want to programmatically delete the cache you should use the Cache facade like so
use Illuminate\Support\Facades\Cache;
Cache::flush();
More info about it in the documentation.

Loading Moqui without Demo Data

I'm new to Moqui/ Hivemind, I have been able to get Hivemind / Moqui up and running with Demo Data, by loading data using
java -jar moqui.war load conf=conf/MoquiDevConf.xml
however, I need to get Hivemind up without Demo Data (i.e only seed data) and have tried loading data using
java -jar moqui.war load types=seed,seed-inInitial,install conf=conf/MoquiDevConf.xml
System gets up and running, without Demo Data, but the system does not have any styles. What is the best way to load Seed Data (including default style) without Demo Data. Appreciate any pointers
Solved.
It seems like the below section in -> https://www.moqui.org/m/docs/framework/Multi-instance+with+Docker has an error instead of seed-initial it calls out as seed-inInitial, I fixed that with the below command for loading seed data and every thing works well
Working Command -> java -jar moqui.war load types=seed,seed-initial
Step 6: Check the moqui.local instance
You can see if the instance is running from the Instances screen using the 'Check' button in the Instance column. You can also use docker directly to see if the instance is running (with docker ps).
To see the logs for the instance use something like docker logs -f moqui_local
To resolve the moqui.local domain name add it to the system, i.e. in /etc/hosts.
Now in your browser you can go to 'http://moqui.local' and if all worked properly you will see a fresh copy of Moqui running with production settings and a database with only seed, seed-ininitial, and install data loaded. Note that there are no users yet in the system so the Login screen will show you a form to create an admin user. This should be done right away after setting up a new instance so that option is disabled.

.NET Core 2.2 API on IIS returns error if it attempts to connect to Db but otherwise works fine

When I publish my .NET core app to a development IIS server, I make a call to the API and the method works fine locally. This method makes a Db call using a connection string stored in
appSettings.json as well as appSettings.Development.json
Observations:
- Yes, I have ASPNETCORE_ENVIRONMENT = Development and I have both an appSettings.json file AND appSettings.Development.json file
- So I started looking at the published files and I had BOTH of these json files in the published folder, even though appSettings.Development.json properties is set to "Build Action" = content and Copy to Output Directory = Do Not Copy
- If I comment out the code that his the Db, and return dummy data, and republish the api, i get the results fine with no complaints about "development mode"
Error I get when calling the API trying to hit the Db
Error.
An error occurred while processing your request.
Request ID:
0HLL1GOCEHH73:00000001
Development Mode
Swapping to the
Development environment displays detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications.
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the
Development environment by setting the
ASPNETCORE_ENVIRONMENT environment variable to
Development
and restarting the app.
Questions:
- The Db connection strings are in both
[ update ]
Brain-fart! The db connection strings were using 'trusted', so no wonder they worked locally! Once I put in the credentials, and re-published, things worked like I expected. However, the error message threw me off.
Im still not sure why I have both of those appSettings files published? Which one will it use?
I am assuming your appsetting files are named as following:
appSettings.json
appSettings.dev.json
typically, you have to explicitly set the environment to dev. if you use Visual Studio for development, it sets an environment variable that tells the application to put it in dev mode.
Without seeing the initializing logic, I would say in prod it will use the appSettings.json.
Take a look at this article, it explains configuration in more details.

RabbitMQ error on startup - erlexec: HOME must be set

For some reason I cannot start RabbitMQ anymore after it crashed.
I am getting the following error:
erlexec: HOME must be set
I've tried to export my home to /home/ubuntu but still getting the same error.
Any ideas?
I'm assuming that you are trying to start rabbitmq with something like service start rabbitmq-server. If so, the service command strips out environment variables. So you will need to either define it in your start up script or in a config file for your startup script (see https://unix.stackexchange.com/a/44378).
Additionally, I believe the rabbitmq home directory is actually /var/lib/rabbitmq/.
I have found suitable solution for myself. You can run epmd service before RabbitMQ server. This is fixing issue with HOME variable and others.
erlexec needs the environment variable HOME to be set in order to place a cookie (that contains a string). If HOME was for some reason unset in the environment that you are running rabbitmq (or rabbitmqctl) in, then you will get this error.
Try to check if HOME is defined by typing:
$ env
to get the list of defined environments. If it was not defined try to define it with
$ export HOME=/var/lib/rabbitmq
If you are using python3 and tox, note that tox by default does not pass current environment variable to the test environment. You will have to add the following to tox.ini
setdev =
HOME=/var/lib/rabbitmq
Just wanted to mention it because it gave me a headache the entire day today and I finally understood what was the issue and I though I should share this hint.

cloudfoundry - vmc register error with external uri

I installed cloudfoundry with the -D option to change the default domain. Cloudfoundry installs fine and starts but when I try to vmc in I get an error:
swampfox#swampcf:~$ vmc target api.mydomain.com
Successfully targeted to [http://api.mydomain.com]
swampfox#swampcf:~$ vmc register --email emailid#gmail.com --passwd mypass
Creating New User: OK
Attempting login to [http://api.mydomain.com]
Problem with login to 'http://api.mydomain.com', target refused connection (getaddrinfo: Name or service not known), try again or register for an account.
swampfox#swampcf:~$ vmc register --email emailid#gmail.com --passwd mypass
Creating New User: Error 100: Bad request
Can someone help. I need to have the external uri or this is useless for me.
This works fine if I take the default api.vcap.me but it only works on that vm and is not accessable from other infrastructure which is pretty useless.
I have found the issue. There is a bug in vmc-0.3.21. Backed it down to vmc-0.3.18 and everything works now.
Whoof! How to open a bug against vmc?
When you have tried api.vcap.me, did you do this by just changing the endpoint address in config/cloud_controller.yml? If so, it may be worth checking to see if the setup did set the endpoint correctly in all the other configuration files, uaa.yml especially in this case as you are having issues with login.
I have always used the standard configuration (api.vcap.me) and then manually changed the endpoint in all the configuration files using sed, for example, from the config directory;
sed -i 's/\.vcap\.me/.newdomain.com/g' *.yml
Actually I initially installed with default api.vcap.me. Then i wiped out the guest an completely reinstalled with -D mydomain.com. I have subsquently installed another CF on a different guest with api.vcap.me for comparison.
Checked the config /home/cfadmin/cloudfoundry/.deployments/devbox/config/uaa.yml and there is no reverence to api.swampnet.com or api.vcap.me.
Just a quick note. I can successfully login from an external domain like emc.com but i cannot login on the local machine or a machine in the same subnet. Whoof!
I noticed that the controller had external uris false so I set them to ture but that made no difference. If I set them to true on the api.vcap.me instance will that allow me to push and app with an external uri?