dbt to snowflake connections ERROR Profile Not Found - snowflake-cloud-data-platform

I am ned to dbt and currently trying to set up my first profile to run dbt via snowflake.
During the setup process, I have created my profiles.yml
However, when running dbt debug
I receive the following message: profiles.yml file [ERROR not found]
The path where my profile is: /Users/Kakurebono .dbt/profiles.yml
What could be the reason behind not finding the profile?
This is my profile.yml config setup:
udemy-learn-dbt:
target: dev
default:
outputs:
dev:
type: snowflake
account: zpa43768.us-east-1
#User/password auth
user: transform_user
password: xxxx
role: TRANSFORM_ROLE
database: analytics
warehouse: transform_wh
schema: dbt
threads: 1
client_session_keep_alive: False

so the problem was the following:
the Project.yml can only be named with underscore and lower case letters
the Project.yml file contains name: that can be anything and profile: that refers to the Profile.yml file. Please bear in mind that both files are white space sensitive!
Run $ dbt compile once both files are updated and saved then $ dbt debugto check whether everything is running correctly.
The config can be tricky. I would recommend for newbies like myself the Udemy dbt course

Related

PDO Driver not found when execute command

I am facing a problem with my database. Context: Web application referencing members, where it is possible to import members via an xls file repository, a processing is done to save it in database. I try to execute a command that is supposed to run in the background on the production environment, but on the development environment it must be executed manually, to perform the import of the files that have as states "to import". Problem during the execution, the command displays that there are driver problems with PDO, it can't find them.
Any idea where the problem could come from?
You will find here with the detailed errors, as well as the config.yml of the symfony 5 project
In AbstractMySQLDriver.php line 128:
An exception occurred in driver: could not find driver
In Exception.php line 18:
could not find driver
In PDOConnection.php line 40:
could not find driver
doctrine:
dbal:
driver: pdo_mysql
host: '%database_host%'
port: '%database_port%'
dbname: '%database_name%'
user: '%database_user%'
password: '%database_password%'
charset: UTF8
types:
phone_number: Misd\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType
server_version: "%doctrine_server_version%"
options:
1002: 'SET sql_mode=(SELECT REPLACE(##sql_mode, "ONLY_FULL_GROUP_BY", ""))'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
dql:
string_functions:
MONTH: DoctrineExtensions\Query\Mysql\Month
YEAR: DoctrineExtensions\Query\Mysql\Year
regexp: DoctrineExtensions\Query\Mysql\Regexp
replace: DoctrineExtensions\Query\Mysql\Replace
DATE_FORMAT: DoctrineExtensions\Query\Mysql\DateFormat
mappings:
gedmo_tree:
type: annotation
prefix: Gedmo\Tree\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
alias: GedmoTree # (optional) it will default to the name set for the mapping
is_bundle: false
Check if your DATABASE_URL host is correct on your .env file.
You should have something like DATABASE_URL=mysql://dbuser:dbpassword#127.0.0.1:3306/something
If it's correctly setup, check your local installation (usually with sudo apt-get install pdo-mysql)
Also check your php.ini file if extension=pdo_mysql is not commented.
I'm confused I found where my mistake came from. The configuration files were set up correctly but I hadn't run bash before running the command, so it didn't recognize the locally binded augments. Really sorry for this question ... very stupid
The problem here comes from you env file. Make sure you wrote the correct database information there:
DATABASE_URL="mysql://db_user:db_password#127.0.0.1:3306/db_name?serverVersion=5.7"
Also, make sure that you did create your database correctly and you can find here in your database.

IBMCloud - How can I connect to MongoDB?

I'm trying to connect to MongoDB in a IBMCloud instance and I'm using MongoID. I ever use some configurations and try very things. I'm getting the error:
MONGODB | Error running ismaster on address:port: system lib
Here is my mongoid.yml that I'm trying to connect to mongoDB:
development:
clients:
default:
database: databasename
hosts:
- address:port
- address:port
options:
user: 'admin'
password: 'some-password'
auth_mech: :scram
auth_source: admin
connect: :replica_set
replica_set: replset
ssl: true
ssl_ca_cert: ./some-certificate.pem
ssl_verify: true
options:
log_level: :debug
What do I need to add to connect with the mongo database in IBMCloud?
"system lib" is coming from OpenSSL and indicates a problem with the CA certificate, such as the path not referring to an existing file. Note that in the configuration you specified a relative path which could cause problems.
I created https://jira.mongodb.org/browse/RUBY-1946 to add the exception class to the reported message which would clarify where the error is originating in the future.
Upgrade to the current version of Ruby driver (2.10.2 as of this writing) which provides more extensive diagnostics. Set driver log level to debug (https://docs.mongodb.com/mongoid/master/tutorials/mongoid-configuration/#logging). If you are having trouble identifying the problem then, post the
updated error and log messages here.

Running ddev without database

I want to set up a ddev (v1.5.2) project without a database. When I try to overwrite the image in a Docker-Compose YAML it stops with an error.
As suggested for the dba I have overwritten the db image in an additional docker-compose.database.yaml in the .ddev folder.
version: '3.6'
services:
db:
image: "busybox"
I expected it to start without the database and it does, but it seems to do a health check for the database which fails.
Failed to start sitzplan: db container failed: log=, err=container exited, please use 'ddev logs -s db` to find out why it failed
The project is running, but it's not working, because it won't run my post-start hooks, which are necessary. In that means I can't even ignore the error.
First, note that there's now explicit support for just turning off the dba/phpmyadmin container, omit_containers: dba (can also be done in the global ddev config, ~/.ddev/global_config.yaml).
And of course I would recommend just letting the regular db container run and not using it.
But here's a docker-compose.database.yaml that does what you ask for:
version: '3.6'
services:
db:
image: "busybox:latest"
command: sh -c "while true; do sleep 1000; done"
healthcheck:
test: ["CMD", "true"]

Ansible Issue - [Errno 2] No such file or directory

I've been holding off posting here because I feel like this issue could be too vague. I will try my best to explain. I have been through all of the existing questions but they don't seem relevant to what I am doing.
Basically, I have inherited 3 Ec2 Instances that are Dev / Staging / Live web applications in my new role. I use Ansible playbooks to migrate the Database between all environments. We recently had a new website that was deployed onto all three existing instances.
The Dev box recently died so I blew it away and launched a new one, the website looks fine, however exporting and importing the Database no longer works (on the new instance)
Below is the Ansible output:
TASK: [Export database to migrate] ********************************************
failed: [172.**.**.***] => {"changed": true, "cmd": "wp db export dbv2.sql --tables=t*******0_links,t*******0_options,t*******0_postmeta,t*******0_posts,taxlt4ws0_rg_form,taxlt4ws0_rg_form_meta,taxlt4ws0_rg_form_view,t*******0_term_relationships,t*******0_term_taxonomy,t*******0_termmeta,t*******0_terms,t*******0_usermeta,t*******0_users", "delta": "0:00:00.001594", "end": "2017-09-01 10:21:25.225355", "rc": 127, "start": "2017-09-01 10:21:25.223761", "warnings": []}
stderr: /bin/sh: 1: wp: not found
FATAL: all hosts have already failed -- aborting
Things I've checked:
Chmod on the folders it import/exports in/from.
IAM Role is set
Used Shell instead of Command in the Playbook
Configs for each environment
I'm really stumped my Ansible knowledge is quite limited as I only picked it up a couple months ago and hadn't run into any issues (even with a new Website) until the Dev box had to be replaced.
I think ansible is referring to wpcli. It is not able to find its executable.
If this is the case,you need to install it with another task before that one.
Basically what this is complaining about is that whatever script you are using in module Export DB is not able to find a wp script or executable.
stderr: /bin/sh: 1: wp: not found
Would recommend checking which wp or maybe do a find to see if it is on the staging or live instances to see what it is and install/copy it over to the Dev instances.
You can test this hypothesis by using a small test script:
#!/bin/sh
wp
create this script say test.sh, give it executable permissions and run it on all the env's to see where it fails.

Jhipster and Postgres connection

I'm trying to run the project in Jhipster based on this tutorial by the creator himself :https://www.youtube.com/watch?v=d1MEM8PdAzQ but it can't connect to Postgres
See errors below:
Caused by: org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:473)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:203)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:146)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:35)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:47)
at org.postgresql.jdbc42.AbstractJdbc42Connection.<init>(AbstractJdbc42Connection.java:21)
at org.postgresql.jdbc42.Jdbc42Connection.<init>(Jdbc42Connection.java:28)
at org.postgresql.Driver.makeConnection(Driver.java:415)
at org.postgresql.Driver.connect(Driver.java:282)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:316)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:518)
How do I connect Jhipster with postgreSQL? I am a newbie on jhipster
JHipster creates 3 configuration files: -
application.yml - main Spring Boot configuration file.
application-dev.yml
application-prod.yml
The application.yml file contains common properties, the other 2 hold specific properties to development and production environments.
If you look at application-dev.yml you'll see something like the following: -
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://localhost:5432/myapp
username: myapp
password:
However, you still have to create your PostgreSQL database - the easiest way is via the pgAdmin tool but you can also create it via command line tools - a quick google will help you there!
If you don't want to work with docker compose file Version 3 in docker swarm mode, where it is best practice to use docker secrets, then you can create an .application.env-file and link it in your docker-compose.yml (Version 2) with 'env_file:'
$ cat .application.env
SPRING_PROFILES_ACTIVE=prod,swagger
SPRING_DATASOURCE_URL=jdbc:postgresql://postgresql:5432/database_name
SPRING_DATASOURCE_USER=database_user
SPRING_DATASOURCE_PASSWORD=database_password
JHIPSTER_SLEEP=10
[...]
At least I use it this way to keep the credentials away from my jhipster-projects, which are on Github, where I also want to put the *.yml-files.

Resources