I can't configure lando with xdebug - xdebug

I am trying to setup Xdebug with a Lando Drupal site. I have tried a lot of different lando configurations but no matter what I do I can't get xdebug to show up in my phpinfo. The current configuration I have is:
name: content-engine-1
recipe: pantheon
config:
framework: drupal8
site: content-engine-1
id: bdfe297a-e96b-401d-b932-158854085e0e
xdebug: true
php: .lando.php.ini
services:
appserver:
xdebug: true
overrides:
environment:
PHP_IDE_CONFIG: "serverName=appserver"
here's the .lando.php.ini file
xdebug.remote_enable=true
xdebug.remote_host="127.0.0.1"
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_log="/var/tmp/xdebug.log"
xdebug.remote_autostart=true
here is the output from phpinfo():
phpinfo output

Based on Documentation https://docs.lando.dev/config/php.html#configuration
it should be
name: content-engine-1
recipe: pantheon
config:
framework: drupal8
site: content-engine-1
id: bdfe297a-e96b-401d-b932-158854085e0e
xdebug: true
config:
php: .lando.php.ini

Related

Ansible get_url behind Proxy requirements

I am trying to download various artefacts for confluent version using get_url module. I am behind a proxy and below is my playbook.
I have to put in a proxy information for one of the downloads, but not for other. Trying to find out how do I determine which ones need proxy details defined in the task and which ones should not have that information. I got verify cert error when I had added proxy information to the second task.
Is there a way to avoid setting that information in the task for the first download task as well
tasks:
- name: Download Confluent enterprise version
get_url:
url: https://packages.confluent.io/archive/7.0/confluent-7.0.7.tar.gz
dest: /export/home/svcuser/tmp
use_proxy: yes
register: showconfluentdlstatus
environment:
http_proxy: http://myuserid:mypassword#proxy.prudential.com:8080/
https_proxy: https://myuserid:mypassword#proxy.prudential.com:8080/
- name: show confluent enterprise download status
debug: var=showconfluentdlstatus
- name: uncompress confluent enterprise
unarchive:
src: /export/home/svcuser/tmp/confluent-7.0.7.tar.gz
dest: /export/home/svcuser/tmp/confluent_7.0.7/
register: unarchiveconfluentstatus
- name: show unarchive confluent status status
debug: var=unarchiveconfluentstatus
- name: Download Confluent playbook for same version as enterprise confluent version
# Proxy doesn't seem to be needed for this
get_url:
url: https://github.com/confluentinc/cp-ansible/archive/refs/heads/7.0.7-post.zip
dest: /export/home/svcuser/tmp
register: showconfluentplaybookdlstatus
- name: show confluent playbook for same version as enterprise confluent version download status
debug: var=showconfluentplaybookdlstatus
- name: uncompress playbook for same version as enterprise confluent version download status
unarchive:
src: /export/home/svcuser/tmp/cp-ansible-7.0.7-post.zip
dest: /export/home/svcuser/tmp/confluent_7.0.7/
register: unarchiveconfluentplaybookstatus
- name: show unarchive confluent playbook for same version as enterprise confluent version status
debug: var=unarchiveconfluentplaybookstatus

Custom docker image as workspace

I just deployed an Eclipse Che environment on my microk8s server and it works great with the sample devfiles. Now I want to use my own repo with a custom devfile.
But everytime I try to start the environment I get the following error message: Container tools has state CrashLoopBackOff.
This only happens with the custom devfile.yaml but not with the default one. The problem is, I need a more recent version of Golang, so I need a different file.
This is the devfile.yaml
schemaVersion: 2.1.0
metadata:
name: kubernetes-image-version-checker
components:
- name: tools
container:
image: quay.io/devfile/golang:latest
env:
- name: GOPATH
value: /projects:/home/user/go
- name: GOCACHE
value: /tmp/.cache
memoryLimit: 2Gi
mountSources: true
command: ['/checode/entrypoint-volume.sh']
projects:
- name: kubernetes-image-version-checker
git:
remotes:
origin: "https://gitlab.imanuel.dev/DerKnerd/kubernetes-image-version-checker.git"

How to use Google Cloud Debugger on Cloud Run with Django

I'm trying to use Google Cloud Debugger on Cloud Run with Django. I red this document.
https://cloud.google.com/debugger/docs/setup/python
What I did.
I turned on Debugger in google cloud.
Install google-python-cloud-debugger.
I created source-context.json same directory with models.py
I add this code in manage.py
try:
import googleclouddebugger
googleclouddebugger.enable()
except ImportError:
pass
I update container of Google Cloud Run. How ever I cant find any application in Debugger
I imported my source code from GitHub. I can see my code in Debugger. However, I couldn't check break point in Debugger page.
How to debug Django on Clod Run? Please help me.
Update
I did this 2 step.
Add logger Cloud Debugger Agent rights to the service account from IAM.
Connect GitHub repository with Google Cloud Source
Cloud Debugger works on local environment. However it doesn't work in Cloud Run.
This picture has only local application. I can't find Cloud Run application.
This is my yaml file. (I'm using Cloud Run as full managed mode)
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: my_app
namespace: '135253772466'
selfLink: /apis/serving.knative.dev/v1/namespaces/135253772466/services/my_app
uid: 61b4ac55-4aab-4d33-801d-d21b0d116ea4
resourceVersion: AAWmjubgiTg
generation: 176
creationTimestamp: '2020-04-14T12:38:39.484473Z'
labels:
cloud.googleapis.com/location: asia-northeast1
annotations:
run.googleapis.com/client-name: gcloud
serving.knative.dev/creator: 135253772466#cloudbuild.gserviceaccount.com
serving.knative.dev/lastModifier: 135253772466#cloudbuild.gserviceaccount.com
client.knative.dev/user-image: gcr.io/my_project/my_app
run.googleapis.com/client-version: 291.0.0
spec:
traffic:
- percent: 100
latestRevision: true
template:
metadata:
name: my_app-00176-wud
annotations:
run.googleapis.com/client-name: gcloud
client.knative.dev/user-image: gcr.io/my_project/my_app
run.googleapis.com/client-version: 291.0.0
autoscaling.knative.dev/maxScale: '1000'
spec:
timeoutSeconds: 900
serviceAccountName: 135253772466-compute#developer.gserviceaccount.com
containerConcurrency: 80
containers:
- image: gcr.io/my_project/my_app
ports:
- containerPort: 8080
env:
- name: CLOUD_RUN_HOST
value: my_app-u3ljntrlma-an.a.run.app
resources:
limits:
cpu: 1000m
memory: 2048Mi
status:
conditions:
- type: Ready
status: 'True'
lastTransitionTime: '2020-05-26T15:39:32.595Z'
- type: ConfigurationsReady
status: 'True'
lastTransitionTime: '2020-05-26T15:39:25.640Z'
- type: RoutesReady
status: 'True'
lastTransitionTime: '2020-05-26T15:39:32.595Z'
observedGeneration: 176
traffic:
- revisionName: my_app-00176-wud
percent: 100
latestRevision: true
latestReadyRevisionName: my_app-00176-wud
latestCreatedRevisionName: my_app-00176-wud
address:
url: https://my_app-u3ljntrlma-an.a.run.app
url: https://my_app-u3ljntrlma-an.a.run.app

Where is the cassandra.yaml location on the MAC?

I am working on the docker environment, and executed docker exec -it mycassandra cqlsh. Then, I am inserting the data, and it is occurring the following error:
WriteTimeout - Error from server: code=1100
By this, it tells me that I need to find out the cassandra.yaml document and amend the write-time, but I can not find that on my MAC.
Could you tell me how can I find it and how to amend the document?
Thanks.
for those who have installed it as brew install cassandra, yaml file will located in usr/local/etc/cassandra
If you are running the official cassandra image then cassandra.yaml may be found at /etc/cassandra/cassandra.yaml in the container. If you want to create a custom cassandra.yaml file then you may try to overwrite it in your Dockerfile or docker-compose.yml file. For example, in my docker-compose.yml file I have something like:
services:
cassandra:
image: cassandra:3.11.4
volumes:
- ./cassandra.yaml:/etc/cassandra/cassandra.yaml
which causes the cassandra.yaml file in the container to be overwritten by my local cassandra.yaml.
I hope this helps.
From the provided example, it seems that the database is executed from inside a container. So the cassandra.yaml that you're looking for will be created on the fly when the container is started up, based on the configuration that you provided.
We have set Cassandra Containers with Kubernetes, and execute them in docker, based on the instructions found here, and been able to modify the settings of the cassandra.yaml file in the configuration of the statefulset, updating the variables in env for the spec of the container.
For example, to modify the seeds list, the cluster name, and the rack of the C* cluster named c-test-qa:
apiVersion: apps/v1
kind: StatefulSet
...
spec:
serviceName: c-test-qa
replicas: 1
selector:
matchLabels:
app: c-test-qa
template:
metadata:
labels:
app: c-test-qa
spec:
containers:
- name: c-test-qa
image: cassandra:3.11
imagePullPolicy: IfNotPresent
...
env:
- name: CASSANDRA_SEEDS
value: c-test-qa-0.c-test-qa.qa.svc.cluster.local
- name: CASSANDRA_CLUSTER_NAME
value: "testqa"
- name: CASSANDRA_RACK
value: "DC1"
- name: CASSANDRA_RACK
value: "CustomRack1"
...
On MacOS :
It will be found in either of the below locations:
Cassandra package installations: /etc/cassandra
Cassandra tarball installations: install_location/conf
DataStax Enterprise package installations: /etc/dse/cassandra
DataStax Enterprise tarball installations: install_location/resources/cassandra/conf

How to solve this SQLSTATE[HY000] [2002] no connection could be made because the target machine actively refused it

I am trying to follow an e-commerce tutorial where I have to create the connection with the database. I am on windows 7 with xampp v3.2.
So I use this : php bin/console generate:doctrine:entity
which gives me this error :
SQLSTATE[HY000] [2002] no connection could be made because the target
machine actively refused it
I closed xampp and I still had the same error. So I understand it comes from the configuration; somehow my shell doesn't communicate with my sql server from xampp.
here is my parameters.yml :
# This file is auto-generated during the composer install
parameters:
database_host: localhost
database_port: 3306
database_name: market
database_user: sebastian
database_password:
mailer_transport: smtp
mailer_host: localhost
mailer_user: null
mailer_password: null
secret:
and here my config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: "#EcommerceBundle/Resources/config/services.yml" }
# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: en
framework:
#esi: ~
#translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
templating:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
handler_id: session.handler.native_file
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
fragments: ~
http_method_override: true
assets: ~
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
I checked for the extension php_pdo_mysql.dl and it is enabled.
I verified the database name, user and password.
here is a netstat :
netstat
Make sure that your MySQL server is running and that it's using that port (in xampp\mysql\bin\my.ini). Make sure that you're able to connect manually with those credentials as well.
Also, where are you specifying the database driver in your parameters.yml? Normally you should have something like this:
database_driver: pdo_mysql
And lastly, make sure that you don't have a different parameters.yml file included in your config_dev.yml because Symfony commands, by default, use the dev environment.
thank you for your answer.
I have in my.ini 3306 port so it is the good one. I have intalled symfony2.8 and it is working so there is no credentials problems. I also tried to add the line with pdo_mysql but the error message is an pdo_exception, that means pdo works as well.
I also check config.dev but I don't really know what can be wrong inside. So I show you what it looks like :
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
console:
type: console
channels: [!event, !doctrine]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
#swiftmailer:
# delivery_address: me#example.com
thank for your help
i cant connect to mysql on xamppp
install mysql 8 on my system on port 3307
and its worked great with laravel.
if you want please install mysql workbench (instead of phpmyadmin)

Resources