Propel: No database selected - propel

I'm want to start to use Propel inside my Kohana 3.x Project. But when I try to run the following command:
C:\propel\generator\projects\myProject>propel-gen reverse
I get the following error:
[propel-schema-reverse] There was an error building XML from metadata: SQLSTATE[
3D000]: Invalid catalog name: 1046 No database selected
[propel-schema-reverse] Schema reverse engineering finished
Anybody know how to solve that?
Additional Information:
Among others I have the folder myProject containing the build.properties file:
C:/propel/generator/projects/myProject/build.properties
This is the "sourcecode" of build.properties:
propel.project = myProject
propel.database = mysql
propel.database.url = mysql:dbname = myProject;host=localhost
propel.database.user = root
propel.database.password =
This is the complete output when I run the command:
C:\propel\generator\projects\myProject>propel-gen reverse
Buildfile: C:\propel\generator\bin\..\build.xml
[resolvepath] Resolved C:\propel\generator\projects\myProject to C:\propel\generator\
projects\myProject
propel-project-builder > check-project-or-dir-set:
propel-project-builder > check-project-set:
propel-project-builder > set-project-dir:
propel-project-builder > check-buildprops-exists:
propel-project-builder > check-buildprops-for-propel-gen:
propel-project-builder > check-buildprops:
propel-project-builder > configure:
[echo] Loading project-specific props from C:\propel\generator\projects\myProject/build.properties
[property] Loading C:\propel\generator\projects\myProject\build.properties
propel-project-builder > reverse:
[phing] Calling Buildfile 'C:\propel\generator\build-propel.xml' with target
'reverse'
[property] Loading C:\propel\generator\.\default.properties
propel > reverse:
[echo] +-----------------------------------------------+
[echo] | |
[echo] | Generating XML from PDO connection ! |
[echo] | |
[echo] +-----------------------------------------------+
[propel-schema-reverse] There was an error building XML from metadata: SQLSTATE[
3D000]: Invalid catalog name: 1046 No database selected
[propel-schema-reverse] Schema reverse engineering finished
BUILD FINISHED
Total time: 0.4205 seconds

Try in build.properties :
propel.database.url = 'mysql:host=localhost;dbname=myProject'
(following Propel http://www.propelorm.org/wiki/Documentation/1.5/BuildConfiguration#DatabaseSettings and PDO http://www.php.net/manual/en/pdo.connections.php docs)

For anyone trying to locate the exact error use the -verbose and -debug mode with propel-gen
propel-gen . reverse -verbose -debug
as this gives each output of the query that php/propel hits during script execution.

Related

baseDir issue with nextflow

This might be a very basic question for you guys, however, I am have just started with nextflow and I struggling with the simplest example.
I first explain what I have done and the problem.
Aim: I aim to make a workflow for my bioinformatics analyses as the one here (https://www.nextflow.io/example4.html)
Background: I have installed all the packages that were needed and they all work from the console without any error.
My run: I have used the same script as in example only by replacing the directory names. Here is how I have arranged the directories
location of script
~/raman/nflow/script.nf
location of Fastq files
~/raman/nflow/Data/T4_1.fq.gz
~/raman/nflow/Data/T4_2.fq.gz
Location of transcriptomic file
~/raman/nflow/Genome/trans.fa
The script
#!/usr/bin/env nextflow
/*
* The following pipeline parameters specify the refence genomes
* and read pairs and can be provided as command line options
*/
params.reads = "$baseDir/Data/T4_{1,2}.fq.gz"
params.transcriptome = "$baseDir/HumanGenome/SalmonIndex/gencode.v42.transcripts.fa"
params.outdir = "results"
workflow {
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true )
INDEX(params.transcriptome)
FASTQC(read_pairs_ch)
QUANT(INDEX.out, read_pairs_ch)
}
process INDEX {
tag "$transcriptome.simpleName"
input:
path transcriptome
output:
path 'index'
script:
"""
salmon index --threads $task.cpus -t $transcriptome -i index
"""
}
process FASTQC {
tag "FASTQC on $sample_id"
publishDir params.outdir
input:
tuple val(sample_id), path(reads)
output:
path "fastqc_${sample_id}_logs"
script:
"""
fastqc "$sample_id" "$reads"
"""
}
process QUANT {
tag "$pair_id"
publishDir params.outdir
input:
path index
tuple val(pair_id), path(reads)
output:
path pair_id
script:
"""
salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
"""
}
Output:
(base) ntr#ser:~/raman/nflow$ nextflow script.nf
N E X T F L O W ~ version 22.10.1
Launching `script.nf` [modest_meninsky] DSL2 - revision: 032a643b56
executor > local (2)
executor > local (2)
[- ] process > INDEX (gencode) -
[28/02cde5] process > FASTQC (FASTQC on T4) [100%] 1 of 1, failed: 1 ✘
[- ] process > QUANT -
Error executing process > 'FASTQC (FASTQC on T4)'
Caused by:
Missing output file(s) `fastqc_T4_logs` expected by process `FASTQC (FASTQC on T4)`
Command executed:
fastqc "T4" "T4_1.fq.gz T4_2.fq.gz"
Command exit status:
0
Command output:
(empty)
Command error:
Skipping 'T4' which didn't exist, or couldn't be read
Skipping 'T4_1.fq.gz T4_2.fq.gz' which didn't exist, or couldn't be read
Work dir:
/home/ruby/raman/nflow/work/28/02cde5184f4accf9a05bc2ded29c50
Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`
I believe I have an issue with my baseDir understanding. I am assuming that the baseDir is the one where I have my file script.nf I am not sure what is going wrong and how can I fix it.
Could anyone please help or guide.
Thank you
Caused by:
Missing output file(s) `fastqc_T4_logs` expected by process `FASTQC (FASTQC on T4)`
Nextflow complains when it can't find the declared output files. This can occur even if the command completes successfully, i.e. with exit status 0. The problem here is that fastqc simply skips files that don't exist or can't be read (e.g. permissions problems), but it does produce these warnings:
Skipping 'T4' which didn't exist, or couldn't be read
Skipping 'T4_1.fq.gz T4_2.fq.gz' which didn't exist, or couldn't be read
The solution is to just make sure all files exist. Note that the fromFilePairs factory method produces a list of files in the second element. Therefore quoting a space-separated pair of filenames is also problematic. All you need is:
script:
"""
fastqc ${reads}
"""

How to pass sh command inside withCredentials for maven in Jenkins file

I'm always getting the not found error in the 6th line(Dsonar.branch.name) of the code from my Jenkinsfile below. If I swap the 6th line as Dsonar.sources it says the source is not found.
withCredentials([string(credentialsId: 'sonar_token', variable: 'token')]) {
sh"""
mvn sonar:sonar \
-Dsonar.projectKey=app \
-Dsonar.host.url=https://sonarqube.test.dev \
-Dsonar.login="917336a835asdf3528c863498"\
-Dsonar.exclusions=$env.WORKSPACE/apps/core-app/src/test
-Dsonar.branch.name=$env.BRANCH_NAME
-Dsonar.sources=$env.WORKSPACE/apps/
-Dsonar.exclusions=$env.WORKSPACE/registry/apps/support-app/src/test
-Dsonar.exclusions=src/apitest/**,src/test/**
"""
}
Error below,
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:13 min
[INFO] Finished at: 2022-01-18T07:15:59Z
[INFO] ------------------------------------------------------------------------
+ -Dsonar.branch.name=feature/docker-build
/home/jenkins/agent/workspace/nt-registry_feature_docker-build#tmp/durable-d9e51887/script.sh: 3: -Dsonar.branch.name=feature/docker-build: not found
I have used the function below instead sh command. It works as expected.
sonarResult = sonarqubeScan(
serverName: 'sonarqube',
sonarScannerExec: "$env.WORKSPACE/sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner",
credentialsId: 'sonar_token',
sources: ".",
addlArgs: config.sonar.sonarAdditionalArguments
)

How to retrieve build_id of latest successful build in Jenkins?

Generally, to get the artifact of the latest successful build, I do a wget on the below URL:
http://jenkins.com/job/job_name/lastSuccessfulBuild/artifact/artifact1/jenkins.txt
Is there a way, I can do a wget on lastSuccessfulBuild and get a build_id like below?
build_id=`wget http://jenkins.p2pcredit.local/job/job_name/lastSuccessfulBuild`
Yes, there is a way and it is pretty straightforward:
$ build_id=`wget -qO- jenkins_url/job/job_name/lastSuccessfulBuild/buildNumber`
$ echo $build_id
131 # that's my build number
I think the best solution is using groovy with zero dependencies.
node {
script{
def lastSuccessfulBuildID = 0
def build = currentBuild.previousBuild
while (build != null) {
if (build.result == "SUCCESS")
{
lastSuccessfulBuildID = build.id as Integer
break
}
build = build.previousBuild
}
println lastSuccessfulBuildID
}
}
You do not need specify jenkins_url or job_name etc to get last successful build id.
Then you could use it easily in all Jenkinsfile in repositories without useless configurations.
Tested on Jenkins v2.164.2
I find very useful querying permalinks file inside Jenkins workspace.
This allows you, to not only get the last successful build, but also other builds Jenkins considers relevant.
You can see it's content adding this line in Build section, in Execute Shell panel:
cat ../../jobs/$JOB_NAME/builds/permalinks
For example, in my case:
+ cat ../../jobs/$JOB_NAME/builds/permalinks
lastCompletedBuild 56
lastFailedBuild 56
lastStableBuild 51
lastSuccessfulBuild 51
lastUnstableBuild -1
lastUnsuccessfulBuild 56
From there, you would want to parse the number of the last successful build, or any other provided by permalinks, you can do this running:
lastSuccesfulBuildId=$(cat ../../jobs/$JOB_NAME/builds/permalinks | grep lastSuccessfulBuild | sed 's/lastSuccessfulBuild //')
If you want the DisplayName of the last successful job and not build number:
curl --user <username>:<tokenOrPassword> https://<url>/job/<job-name>/lastSuccessfulBuild/api/json | jq -r '.displayName'
Or in groovy
def buildName = Jenkins.instance.getItem('jobName').lastSuccessfulBuild.displayName
Pipeline script solution :
import groovy.json.JsonSlurper
def jResponse = httpRequest "https:/<yourjenkinsjoburlpath>/lastSuccessfulBuild/buildNumber"
def json = new JsonSlurper().parseText(jResponse.content)
echo "Status: ${json}"
jenkins console output:
HttpMethod: GET
URL: https://***/lastSuccessfulBuild/buildNumber
Sending request to url: https://***/lastSuccessfulBuild/buildNumber
Response Code: HTTP/1.1 200 OK
Success code from [100‥399]
[Pipeline] echo
Status: 20
To get the last successful build number using curl:
curl --user userName:password https://url/job/jobName/api/xml?xpath=/*/lastStableBuild/number
to get the job build number simply do:
def build_Number = Jenkins.instance.getItem('JobName').lastSuccessfulBuild.number

gradlew build is been failed,only for grunt default it was getting failed

I am trying to do gradlew build in my local machine:
I am getting an error message:
Running "sprite:all" (sprite) task
Fatal error: Unsupported file type: .jpg
:build FAILED
FAILURE: Build failed with an exception.
Where:
Build file 'D:\DL\build.gradle' line: 52
What went wrong:
Execution failed for task ':grunt_default'.
Process 'command 'cmd'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output
BUILD FAILED
Total time: 21.972 secs
using code in Gruntfile.js:
sprite:{
all: {
src: baseDir + 'web/sass/sprites/*',
destImg: baseDir + 'web/webroot/_ui/desktop/theme/images/sprites.png',
destCSS: baseDir + 'web/sass/sprites.scss',
'cssVarMap': function (sprite) {
sprite.name = 'sprite-' + sprite.name;
},
'padding': 2,
'algorithm': 'alt-diagonal',
'imgPath': '../images/sprites.png',
}
},
Tried to setup imagemagick still it wasn't working

Error when building GRUB2 module with efi's "grub_efi_get_variable" function

This is in my Makefile.core.def:
...
...
module = {
name = mymod;
common = net/mymod.c;
};
...
...
When I tried to build I get:
mv syminfo.lst.new syminfo.lst
cat syminfo.lst | sort | gawk -f /build/boot_project/src/grub/grub2/grub-core/genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1)
grub_efi_get_variable in mymod is not defined
make[5]: *** [moddep.lst] Error 1
mymod.c has "#include <grub/efi/efi.h>" and tries to use "grub_efi_get_variable" function. I see that in syminfo.lst
> more syminfo.lst
...
undefined mymod grub_efi_get_variable
...
Can someone shed a light on the error and how to fix?
Thanks,
P.S I edited Makefile.core.def and Makefile.core.am in /build/boot_project/src/grub/grub2/grub-core/ to include my module and ran autogen.sh in /build/boot_project/src/grub/ to regenerate Makefile.in, then I ran dmake in /build/boot_project/src/grub/
Configuration was ran with --with-platform=efi. Anyhow, I noticed Makefile.core.am has all platform enabled for module mymod. So I edited Makefile.core.def to: module = { name = mymod; common = net/mymod.c; enable = efi}; After re-running autogen.sh, only platform with efi were added to Makefile.core.am and the build works.

Resources