how to change default port 8080 of "quarkus keycloak" in windows - port

Whenever I am trying to run the command - kc.bat start-dev --http-port="port number", its showing some error called "unmatched argument at index 3: "port number".

The property needs to be set in keycloak.conf file available under keycloak/conf folder.
Along with several other properties just add
http-port=PORT NUMBER
and this will work every time.
More info can be found here -> https://www.keycloak.org/server/all-config

try this command for changing default port to custom port of Keycloak Quarkus distributor
kc.bat start-dev dummy --http-port

Related

Connection was not established. Probably 'xdebug.remote_host=host.docker.internal' is incorrect. Change 'xdebug.remote_host'

I'm trying to use Xdebug (v3) through PhpStorm (v2022.3.2) to debug a PHPUnit test method from inside a Docker container.
Xdebug is correctly setup and also the server in PhpStorm is.
In fact, if I run tests from command line, Xdebug stops at breakpoints:
XDEBUG_SESSION=1 PHP_IDE_CONFIG="serverName=myapp.localhost" vendor/bin/phpunit --testdox --filter testProfileUpdate
If I debug the test clicking on the "bug" icon on the left of the test method, instead, I receive the following error:
Connection was not established. Probably 'xdebug.remote_host=host.docker.internal' is incorrect. Change 'xdebug.remote_host'.
Looking at the command executed by PhpStorm to debug a test method, here is what I see:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Tried to configure two more flags
I've also tried to configure two more flags:
-dxdebug.idekey="serverName=myapp.localhost"
-dxdebug.session=1
The resulting command is this:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal -dxdebug.idekey="serverName=myapp.localhost" -dxdebug.session=1 /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Also with this configuration, Xdebug doesn't start and breakpoints are ignored (and the error message pops up).
Tried to disable params passed by PhpStorm
I tried to disable params passed automatically by PhpStorm going to Settings > PHP > Debug.
Then, in the section "Advanced settings" I unflagged the option "Pass required configuration options through command line".
Now, the resulting command is this:
[docker://myapp:latest/]:php /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
As you can see, there is no mention of xdebug.client_host nor of xdebug.remote_host.
Nevertheless, PhpStorm continues to pop up the same error mentioning xdebug.remote_host=host.docker.internal.
I imagined that an error should have occurred, but different, something saying a required parameter is missed.
Request for help
Any idea about how to configure PhpStorm to start an Xdebug session to debug a PHPUnit test?
-dxdebug.client_port=9000
Xdebug 3 now uses 9003 port by default instead of 9000. Try sticking to this.
In PhpStorm you most likely have both ports listed (9000,9003 as a default value, to cover new and old Xdebug versions) and it uses the first one for CLI scripts (which PHPUnit is). Either remove it (preferred; so you will only have 9003 there) or make it last (i.e. 9003,9000).
-dxdebug.idekey="serverName=myapp.localhost"
This will not work (wrong approach). You are trying to pass it as Xdebug IDEKey param... but it actually should be the value of the ENV variable named PHP_IDE_CONFIG.
If you want to actually use it:
Look into the PHPUnit config file: it has the ability to set up custom ENV variables for tests.
Another place: PhpStorm's Run/Debug Configuration for PHPUnit has an Environment variables field: try using it for this purpose.
Or use it in your actual docker file/config.
Other than that: enable Xdebug log (xdebug.log), try to debug (both when it's working and when it's not) and see what the log has to say for both runs (where it connects to, what the response is etc). You should spot the difference that should give the clues on what might be wrong (in which direction to dig further).
This actually should be the first step when investigating "why it works here and not there" situations.

Error with docker-compose up for Spring Cloud Dataflow - "DATAFLOW_VERSION is not set!"

I am a newbie to spring-cloud-data-flow. I am following the documentation of Spring Cloud Data Flow (https://dataflow.spring.io/docs/installation/local/docker/). I have downloaded docker-compose.yml file and put it in D:\Dev\spring-cloud-dataflow> directory. When I try to run following commands:
D:\Dev\spring-cloud-dataflow> set DATAFLOW_VERSION=2.1.0.RELEASE
D:\Dev\spring-cloud-dataflow> set SKIPPER_VERSION=2.0.2.RELEASE
D:\Dev\spring-cloud-dataflow> docker-compose up
It gaves me following error:
ERROR: Missing mandatory value for "image" option in service "dataflow-server": DATAFLOW_VERSION is not set!
I am using Powershell, so I tried to use Set-Variable instead of set, but this gave me the same error.
D:\Dev\spring-cloud-dataflow> Set-Variable -Name "DATAFLOW_VERSION" -Value "2.1.0.RELEASE"
D:\Dev\spring-cloud-dataflow> Set-Variable -Name "SKIPPER_VERSION" -Value "2.0.2.RELEASE"
D:\Dev\spring-cloud-dataflow> docker-compose up
ERROR: Missing mandatory value for "image" option in service "dataflow-server": DATAFLOW_VERSION is not set!
I tried the short handed version in the tutorial but did not worked also:
DATAFLOW_VERSION=2.1.0.RELEASE SKIPPER_VERSION=2.0.2.RELEASE docker-compose up
I can see the variables are set:
D:\Dev\spring-cloud-dataflow> echo $DATAFLOW_VERSION
2.1.0.RELEASE
D:\Dev\spring-cloud-dataflow> echo $SKIPPER_VERSION
2.0.2.RELEASE
I could not understand why this error pops up.
Not sure about why it doesn't resolve the variables. Maybe the resolution of the variable doesn't take place in your environment (Windows?).
For the time being, can you set the version values explicitly inside the docker compose yml file and run to see if it sets up correctly?
I've encountered the same issue in windows 10. Set the variables via "Edit the system environment variables" under control panel instead of using "Set" command solved the problem. May help others using windows 10.
#selins_sofa, The PowerShell has a peculiar way for setting environment variables:
$Env:<variable-name> = "<new-value>"
So you should set the DataFlow and Skipper versions like this:
$Env:DATAFLOW_VERSION="2.5.0.BUILD-SNAPSHOT"
$Env:SKIPPER_VERSION="2.4.0.BUILD-SNAPSHOT"

Nextcloud trusted domain with auto configuration via environment variables

When i'm configure nextcloud (which run in docker container ) using environment variables , i can't visit site after it and i need to configure manually with connection to docker with bash .
How to solve this problem or make it automatically without creating my own docker image?
The environment variable only gets picked up and applied to the config when building a brand new instance. If you've already created a config.php file which is mapped in that volume, that environment variable will not override it.
If you want to keep your existing config intact, you need to SSH into your NAS and go to your Nextcloud Docker folder and find /config/config.php. For me this was located at: /docker/nextcloud/config/www/nextcloud/config
Then type: sudo nano config.php
Quick vi refresher - i to insert, esc to exit edit mode, and :qw to quit write mode but in this instance you may need to use :qw!
And add a new domain just add new entries by appending a new item to the PHP array:
'trusted_domains' =>
array (
0 => '192.168.0.29',
1 => 'cloud.example.com',
),
Reference: https://help.nextcloud.com/t/howto-add-a-new-trusted-domain/26
That sounds like an issue with Trusted Domains.
If you have a look at their repository (readme) at https://github.com/nextcloud/docker you will see an environment variabled called NEXTCLOUD_TRUSTED_DOMAINS which you can set in your docker environment.
Alternatively, you will find it in the {app}/config/config.php
The default values set for it, in my experience, is only 'localhost' to enable connecting to NextCloud from localhost at the very least.
Hope this helps.

Create memcached service in windows failed

I'm using Memcached-for-Windows, see:
http://blog.elijaa.org/index.php?post/2010/08/25/Memcached-1.4.5-for-Windows&similar
I've tried to use:
sc create "memcached" binPath="C:/memcached/mem
cached.exe" start=auto
but I can't create the Windows service, and no warning or error, just:
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
(default = own)
start= <boot|system|auto|demand|disabled>
(default = demand)
error= <normal|severe|critical|ignore>
(default = normal)
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
(default = LocalSystem)
DisplayName= <display name>
password= <password>
To implement this, you can even execute a command line, which inturn creates a service.
First go to the path where the .exe file exists through command line.
C:\Users\sireesh.yarlagadda>memcached.exe -d install
After executing this line, you will be seeing a new service created for memcached
The reason you're getting an error is that there must be a space after the binPath= . This is a very annoying 'feature' of sc. Also you'd need a space after the start=.
sc create "memcached" binPath= "C:/memcached/memcached.exe" start= auto
The above command wouldn't give you the syntax error. However, I suspect memcached still won't run successfully as a service.
memcached isn't a native Windows Service so you must use a "service wrapper" program to add the missing functionality. Microsoft's free Srvany utility should do the trick but several commercial alternatives are also available.
(Note that some Windows ports of memcached support the "-d" flag to automatically install and manipulate memcached as a native Windows Service but that doesn't seem to be available in NorthScale's version...)
You can build Memcached on Windows.
http://vasil9v.tumblr.com/post/31921755331/compiling-memcached-on-cygwin-windows

running multiple instance of mongod as service

i try to start multiple Instance of MongoDB as a Service. Under the commandline i can start more than one Mongo Instances, for the first instance i append "--install" to the Command and now it run as service. But now i try to append "--install" to the second Instance and get a Error:
first command runs well:
c:\data\bin\mongod --nohttpinterface --port 27201 --dbpath c:\data\cluster\db1 --master --logpath c:\var\log\mongodb_db1.log --serviceName MongoDB_1 --install
but the second one gives a error:
c:\data\bin\mongod --nohttpinterface --port 28000 --dbpath c:\data\cluster\db2 --master --logpath c:\var\log\mongodb_db2.log --serviceName MongoDB_2 --install
error:
Creating service MongoDB_2. Error creating service. Der Name wird bereits als Dienstname oder als Dienstinstanzname verwendet. (1078)
I think that MongoDB use an internal Servicename that is always the same and differ to the shown servicename. But i don't know how to fix it?
Any suggestions?
Regards
Rene
You can do a polite installation of a 2nd instance using the proper command line switches. Just read my answer here https://stackoverflow.com/a/9273816/249992
I ran into this same issue. My workaround is kind of hacky, but it seems to work:
Create the first mongod service using monogd --install
Open regedit and navigate to HKLM\SYSTEM\CurrentControlSet\services\NameOfMongoService
Export this key
Edit exported reg file in text editor, updating service name and mongod params.
Import into reg (and possibly reboot).
To get mongos running as a service I took a different approach and used instsrv and srvany from the Windows NT Resource Kit:
http://support.microsoft.com/kb/137890
This kb doesn't mention that after intstalling srvany using instsrv you have to add a Parameters sub-key under the newly created service in the registry. This key should contain a REG_SZ named "Application" with the path to the app to start as a service.

Resources