DBGp proxy error Handler response error: Error reading command: Don't understand command '[507]' - phpstorm

Remote debugging using Xdebug DBGp proxy and PhpStorm:
Ubuntu 22.10
PHP 8.1
Xdebug v3.1.2
Xdebug DBGp proxy (0.4.2-dev)
./dbgpProxy
Xdebug DBGp proxy (0.4.2-dev)
Copyright 2020 by Derick Rethans
2023-02-13 07:16:48.394 [warn] [SSL] The 'certs/fullchain.pem' file could not be found, not enabling SSL listeners
2023-02-13 07:16:48.394 [info] [dbgpProxy] Proxy started
2023-02-13 07:16:48.395 [info] [server] Started server server on 127.0.0.1:9003
2023-02-13 07:16:48.395 [info] [server] Started client server on 127.0.0.1:9001
Xdebug settings:
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.log=/tmp/xdebug.log
SSH settings:
RemoteForward 9001 localhost:9001
LocalForward 9001 localhost:9001
Tools -> DBGp proxy -> Register IDE
2023-02-13 07:17:08.768 [info] [server] Start new client connection from 127.0.0.1:33682
2023-02-13 07:17:08.839 [info] [proxyinit] [POLYANIN] Added connection for IDE Key 'POLYANIN': 127.0.0.1:9001
2023-02-13 07:17:08.840 [info] [server] Closing client connection from 127.0.0.1:33682
The error:
2023-02-13 07:28:18.141 [info] [proxy-client] [POLYANIN] Found connection for IDE Key 'POLYANIN': 127.0.0.1:9001
2023-02-13 07:28:18.141 [info] [proxy-client] [POLYANIN] Connecting to 127.0.0.1:9001
2023-02-13 07:28:18.142 [info] [proxy-client] [POLYANIN] IDE connected
2023-02-13 07:28:18.142 [info] [server] Start new client connection from 127.0.0.1:33694
2023-02-13 07:28:18.142 [info] [proxy-client] [POLYANIN] Init forwarded, start pipe
2023-02-13 07:28:18.142 [warn] [server] Handler response error: Error reading command: Don't understand command '[507]'
2023-02-13 07:28:18.142 [info] [server] Closing client connection from 127.0.0.1:33694
2023-02-13 07:28:18.192 [info] [proxy-client] [POLYANIN] IDE closed connection
I put a breakpoint and refresh the page.

You cannot use the DBGp proxy this way, as it always sends the debug data to the host where the IDE registration with the key came from.
Since you are using a tunnel, it always comes from 127.0.0.1; this is why you get Found connection for IDE Key 'POLYANIN': 127.0.0.1:9001, and this is why you get the error message - the proxy tries to send the debug data to itself instead of PhpStorm.
There is an extremely ugly workaround - you can modify the proxy code so that it uses the IDE key as a port number to connect to:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360010264920-xdebug-multiple-developers-php-storm-dbgpproxy

Related

Running fastapi app using uvicorn on ubuntu server

I am dealing with the project deposition made on FastAPI to a remote ubuntu server. I'll try to run the project from terminal (using SSH connection) by the command
gunicorn -k uvicorn.workers.UvicornWorker main:app
The output is
gunicorn -k uvicorn.workers.UvicornWorker main:app
[2020-07-14 15:24:28 +0000] [23102] [INFO] Starting gunicorn 20.0.4
[2020-07-14 15:24:28 +0000] [23102] [INFO] Listening at: http://127.0.0.1:8000 (23102)
[2020-07-14 15:24:28 +0000] [23102] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2020-07-14 15:24:28 +0000] [23104] [INFO] Booting worker with pid: 23104
[2020-07-14 15:24:28 +0000] [23104] [INFO] Started server process [23104]
[2020-07-14 15:24:28 +0000] [23104] [INFO] Waiting for application startup.
[2020-07-14 15:24:28 +0000] [23104] [INFO] Application startup complete.
But I need the project to be available at the IP address of the server. If I try smth like
uvicorn main:app --host 66.226.247.55 --port 8000
I get
INFO: Started server process [23308]
INFO: Waiting for application startup.
INFO: Connected to database postgresql://recognition:********#localhost:5432/reco
INFO: Application startup complete.
ERROR: [Errno 99] error while attempting to bind on address ('66.226.247.55', 8000): cannot assign requested address
INFO: Waiting for application shutdown.
INFO: Disconnected from database postgresql://recognition:********#localhost:5432/reco
INFO: Application shutdown complete.
Where 66.226.247.55 - external IP adress from google cloud platform instances
How do I start a project so that it can be accessed via IP?
The --host should be the local address of your GCP server.
uvicorn main:app --host 0.0.0.0 --port 8000
and now access the application by http://66.226.247.55:8000
Note: You should open your 8000 port of GCP server.
If you're using nginx server
create a file in /etc/nginx/sites-enabled/
create file touch fastapi_nginx
copy code into file and adjust accordingly
server{
listen 80;
server_name "your public ip";
location / {
proxy_pass http://127.0.0.1:8000; #localhost
}
}
This should reroute to your public ip
You cannot launch your fast api app on your local to your remote server in GCP.
You must deploy your app to GCP. In other words you need to run that command on a remote server not your localhost.

How to know where ejabberd is config

I am working on old project where ejabberd is used. In laravel env file this information is written
JABBER_SERVER=localhost
JABBER_ENV=dev
RPC_SERVER= http://xx.xx.xx.xxx:4560/RPC2
JABBER_HOST=localhost
when i try to find the ejabberd service on my ubuntu server i couldn't.I don't have any idea how i can find ejabberd information because i am getting an error.
2019-12-26 07:54:27.338 [info] <0.23787.5>#ejabberd_c2s:process_terminated:264 (tcp|<0.23786.5>) Closing c2s session for prod6067#localhost/121590970668513998469410: Connection failed: connection closed
2019-12-26 07:54:30.577 [info] <0.339.0>#ejabberd_listener:accept:300 (<0.23789.5>) Accepted connection 115.186.58.62:58101 -> 172.31.42.93:5222
2019-12-26 07:54:31.390 [info] <0.23790.5>#ejabberd_c2s:handle_auth_success:423 (tcp|<0.23789.5>) Accepted c2s SCRAM-SHA-1 authentication for prod6067#localhost by mnesia backend from
2019-12-26 07:54:32.166 [info] <0.23790.5>#ejabberd_c2s:bind:394 (tcp|<0.23789.5>) Opened c2s session for prod6067#localhost/151108589900049164879426
If you can run the ejabberdctl shell script, then it will show many information about where ejabberd is installed:
$ ejabberdctl
...
Optional parameters when starting an ejabberd node:
--config-dir dir Config ejabberd: /etc/ejabberd
--config file Config ejabberd: /etc/ejabberd/ejabberd.yml
--ctl-config file Config ejabberdctl: /etc/ejabberd/ejabberdctl.cfg
--logs dir Directory for logs: /usr/local/var/log/ejabberd
--spool dir Database spool dir: /usr/local/var/lib/ejabberd
--node nodename ejabberd node name: ejabberd#localhost

JHipster - Running liquibase:diff fails due to "Access denied"

When adding a field to an Entity in JHipster, the last step (when using MySQL) is running
./mvnw compile liquibase:diff
As per the docs at https://jhipster.github.io/development/
However, this doesn't work for my rather simple install, because the process doesn't use the correct MySQL user and pass. My app runs fine in dev profile, but not like this.
Where does Liquibase get its credentials from?
Below you can see the output.
[INFO] artifact: file:/Users/wouter/.m2/repository/org/glassfish/javax.el/3.0.0/javax.el-3.0.0.jar
[INFO] artifact: file:/Users/wouter/.m2/repository/org/springframework/boot/spring-boot-devtools/1.4.2.RELEASE/spring-boot-devtools-1.4.2.RELEASE.jar
[INFO] artifact: file:/Users/wouter/Business/Workspace/imi-publishing-cloud/target/classes/
[INFO] artifact: file:/Users/wouter/Business/Workspace/imi-publishing-cloud/target/test-classes/
[INFO] ------------------------------------------------------------------------
[INFO] Settings
----------------------------
[INFO] driver: com.mysql.jdbc.Driver
[INFO] url: jdbc:mysql://localhost:3306/imicloud
[INFO] username: root
[INFO] password: *****
[INFO] use empty password: false
[INFO] properties file: null
[INFO] properties file will override? false
[INFO] prompt on non-local database? true
[INFO] clear checksums? false
[INFO] changeLogFile: src/main/resources/config/liquibase/master.xml
[INFO] context(s): null
[INFO] label(s): null
[INFO] referenceDriver: null
[INFO] referenceUrl: hibernate:spring:be.storefront.imicloud.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
[INFO] referenceUsername: null
[INFO] referencePassword: null
[INFO] referenceDefaultSchema: null
[INFO] diffChangeLogFile: src/main/resources/config/liquibase/changelog/20170125143850_changelog.xml
[INFO] ------------------------------------------------------------------------
Wed Jan 25 15:38:57 CET 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.129 s
[INFO] Finished at: 2017-01-25T15:38:58+01:00
[INFO] Final Memory: 63M/787M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:diff (default-cli) on project imicloud: Error setting up or running Liquibase: liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: NO) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It first appears the correct settings are used. My DB is called "imicloud", but then later the error is:
java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: NO)
Obviously I am using a password for MySQL.
How to fix this?
I guess I missed an essential setup step as this is the first time I'm using the liquibase:diff command.
The credentials used by the mvn liquibase commands are found in you pom.xml, in the liquibase plugin's configuration tag. The section of the pom.xml looks like:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/ng2</url>
<defaultSchemaName>ng2</defaultSchemaName>
<username>root</username>
<password></password>
<referenceUrl>hibernate:spring:com.mycompany.myapp.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
<verbose>true</verbose>
<logging>debug</logging>
</configuration>
...
Configure your Spring Boot properties accordingly in your src/main/resources/config/application-.yml or application-.properties files
Add end with your database URL like this.
url: jdbc:mysql://localhost:3306/imicloud?u‌​seSSL=false

unable to invoke mod_rest of jabberd,

i have setup a ejabberd server and enable the mod_rest. i could start ejabberd without problem. however if i invoke the rest service,
i have google module_must_be_started_in_vhost, but no luck. anyone could help?
Error from ejabberbctl live
22:18:13.881 [error] CRASH REPORT Process <0.492.0> with 0 neighbours crashed with reason: {module_must_be_started_in_vhost,mod_rest,<<"xjt.cloudapp.net">>} in mod_rest:try_get_option/3 line 107
22:18:13.881 [error] Supervisor ejabberd_http_sup had child undefined started with {ejabberd_http,start_link,undefined} at <0.492.0> exit with reason {module_must_be_started_in_vhost,mod_rest,<<"xjt.cloudapp.net">>} in context child_terminated
-
port: 5285
module: ejabberd_http
hosts:
- "xjt.cloudapp.net"
request_handlers:
"/rest": mod_rest
Have you installed mod_rest?
I think this is right..
ejabberdctl modules_update_specs
ejabberdctl module_install mod_rest

Sonar 2.13.1 with MySQL 5.1 Issue

We are new to Sonar and just downloaded v2.13.1 and got it up and working with our project. It was great until it started running slowly and I realized it was because we were still running on the included Derby. We are running MySQL Server 5.1 on the same box (along with TeamCity CI), so I followed the steps to setup MySQL.
I ran extras\database\mysql\create_database.sql to create the sonar user and assign permissions.
I updated conf\sonar.properties to include:
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
I restarted the Sonar server and saw from the logs that the database tables were created and I can confirm this independently by browsing the database.
When I start the server, I get the following in the log:
2012.02.07 13:50:58 INFO o.s.c.p.Database Create JDBC datasource
2012.02.07 13:51:01 INFO org.sonar.INFO Initializing Hibernate
2012.02.07 13:51:11 INFO org.sonar.INFO Start services...
When I run our TeamCity configuration that does a "mvn clean install" followed by a "mvn sonar:sonar" goal, which previously worked under Derby, our build completes successfully, but Sonar dies with the following information:
[14:11:24] [west-chai:my-project] [INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # my-project ---
[14:11:26] [west-chai:my-project] [INFO] Sonar version: 2.13.1
[14:11:29] [west-chai:my-project] [WARN] [14:11:29.403] Derby database should be used for evaluation purpose only
[14:11:29] [west-chai:my-project] [INFO] [14:11:29.403] Create JDBC datasource
[14:11:30] [west-chai:my-project] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project my-project: Can not execute Sonar
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] Reactor Summary:
[14:11:30] [INFO]
[14:11:24] [west-chai:my-project] [INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # my-project ---
[14:11:26] [west-chai:my-project] [INFO] Sonar version: 2.13.1
[14:11:29] [west-chai:my-project] [WARN] [14:11:29.403] Derby database should be used for evaluation purpose only
[14:11:29] [west-chai:my-project] [INFO] [14:11:29.403] Create JDBC datasource
[14:11:30] [west-chai:my-project] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project my-project: Can not execute Sonar
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] Reactor Summary:
[14:11:30] [INFO]
[14:11:30] [INFO] PROJECT COMPONENT 1 ................... FAILURE [34.679s]
[14:11:30] [INFO] PROJECT COMPONENT 2 ................... SKIPPED
...
[14:11:30] [INFO] PROJECT COMPONENT N ................... SKIPPED
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] BUILD FAILURE
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] Total time: 41.809s
[14:11:30] [INFO] Finished at: Tue Feb 07 14:11:30 CST 2012
[14:11:31] [INFO] Final Memory: 31M/92M
[14:11:31] [INFO] ------------------------------------------------------------------------
[14:11:31] [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project my-project: Can not execute Sonar: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()', instance 'org.sonar.batch.bootstrap.BatchDatabase#1d4d6a, java.lang.RuntimeException: wrapper: Fail to connect to database: Cannot create PoolableConnectionFactory (java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.) -> [Help 1]
[14:11:31] [ERROR]
[14:11:31] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[14:11:31] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[14:11:31] [ERROR]
[14:11:31] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[14:11:31] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[14:11:31] Process exited with code 1
[14:11:31] [Publishing artifacts] Paths to publish: [E:\apps\TeamCity\server\buildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.1.xml.gz => .teamcity]
[14:11:31] [Publishing artifacts] Sending files
[14:11:31] Step Sonar (Maven) failed
[14:11:31] Waiting for 38 service processes to complete
[14:11:31] Sending build.finish.properties.gz file
[14:11:31] Paths to publish: [MyProject\Mainline\MyApp\target\chai.war, MyProject\Mainline\MyComponent\MyComponent-service\target\MyComponent.war]
[14:11:31] Sending files
[14:11:35] Build finished
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] BUILD FAILURE
[14:11:30] [INFO] ------------------------------------------------------------------------
[14:11:30] [INFO] Total time: 41.809s
[14:11:30] [INFO] Finished at: Tue Feb 07 14:11:30 CST 2012
[14:11:31] [INFO] Final Memory: 31M/92M
[14:11:31] [INFO] ------------------------------------------------------------------------
[14:11:31] [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project my-project: Can not execute Sonar: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()', instance 'org.sonar.batch.bootstrap.BatchDatabase#1d4d6a, java.lang.RuntimeException: wrapper: Fail to connect to database: Cannot create PoolableConnectionFactory (java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.) -> [Help 1]
[14:11:31] [ERROR]
[14:11:31] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[14:11:31] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[14:11:31] [ERROR]
[14:11:31] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[14:11:31] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[14:11:31] Process exited with code 1
[14:11:31] [Publishing artifacts] Paths to publish: [E:\apps\TeamCity\server\buildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.1.xml.gz => .teamcity]
[14:11:31] [Publishing artifacts] Sending files
[14:11:31] Step Sonar (Maven) failed
[14:11:31] Waiting for 38 service processes to complete
[14:11:31] Sending build.finish.properties.gz file
[14:11:31] Paths to publish: [MyProject\Mainline\MyApp\target\chai.war, MyProject\Mainline\MyComponent\MyComponent-service\target\MyComponent.war]
[14:11:31] Sending files
[14:11:35] Build finished
The error line that follows mentions port 1527, which is referenced by the commented out Derby config lines.
[14:11:31] [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project my-project: Can not execute Sonar: PicoLifecycleException: method 'public final org.sonar.core.persistence.DefaultDatabase org.sonar.core.persistence.DefaultDatabase.start()', instance 'org.sonar.batch.bootstrap.BatchDatabase#1d4d6a, java.lang.RuntimeException: wrapper: Fail to connect to database: Cannot create PoolableConnectionFactory (java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.) -> [Help 1]
If I comment out the sonar.jdbc lines above and restore the following lines, then the both our "mvn clean install" and the "mvn sonar:sonar" complete successfully.
sonar.jdbc.url: jdbc:derby://localhost:152/sonar;create=true
sonar.jdbc.driverClassName: org.apache.derby.jdbc.ClientDriver
sonar.jdbc.validationQuery: values(1)
Is there a different configuration for the Maven target than what is used directly by the Sonar server? Is there an explicit way to tell which JDBC datasource is being connected to?
The Sonar server and your Maven client are configured separately.
Unless configured otherwise Maven will automatically assume that Sonar is running locally with a Derby database, explaining your errors.
The Sonar documentation explains how Maven can be configured to support MySQL.
I faced with the similar problem yesterday (April, 11 2012)
1) input:
teamcity 7
maven 3.0.4
sonar 2.13
postgresql 9
global maven settings.xml contains sonar profile with proper DB settings
jdk 1.6.30
project build from command line passed ok
2) result:
teamcity - Can not execute Sonar
log contains exception
Fail to connect to database: Cannot create PoolableConnectionFactory (java.net.ConnectException : Ошибка соединения с сервером localhost на порту 1527
3) possible cause:
TeamCity uses wrong settings.xml
4) solution:
goto Administratioin
goto left menu Integrations->Maven settings
upload your version of settings.xml (in my case with proper settings for Sonar)