I've just installed log parser plugin for jenkins but it doesn't handle multiline errors. Is there a way to make that work?
I've tried:
^Caught exception(.*)(\n(.*)at (.*))+
and
^Caught exception(.*)(\s(.*)at (.*))+
but nothing seems to work.
I am trying to find a solution to the same problem.
Lets assume this is a part of the console output:
1. some text
2. error_type first line
3. error_type second line
4. failed third line
5. some text
I want the text between 2nd and 4th lines to be marked as an error:
I tried the following, but it did not work
error /(?s)error_type(.*\s)failed/
Related
I'm using powerline, bash, and iterm2 on mac. I also installed gitstatus, but that didn't work when I installed it two days ago, and powerline worked just fine yesterday without gistatus functioning. Today, when I booted up the terminal, this error showed instead of the prompt.
Any advice? Where can I find the full log of the errors/interpret this message? Alternatively, how can I pinpoint which file has an error on line 55?
There error was in a color config file for the github integration. I was missing a comma at between lines. I believe it was in this file .config/powerline/colorschemes/default.json or another json related to it; see here.
Ultimately, I recommend moving to powerlevel10k. You can configure it to look exactly like powerline, but it a) updates cleanly (compared to powerline where if you update your python it breaks horribly) and b) comes with a really good customization setup and c) lets you use zsh + oh-my-zsh which gives so much additional functionality
I am a beginner in Python using Spyder to code from Anaconda3.
I tried to enter such codes in Spyder (Python 3.7). I pressed "Enter" when trying to split the codes and the indents appear auto. But it always returns with "SyntaxError: invalid syntax" and "SyntaxError: 'return' outside function".
E.g. 1
data = {'state':['Ohio','Ohio','Ohio','Nevada','Nevada','Nevada'],
'year':[2000,2001,2002,2001,2002,2003],
'pop':[1.5,1.7,3.6,2.4,2.9,3.2]}
When I press F9 in either line, it returns "SyntaxError: invalid syntax".
E.g. 2
def f(x):
return pd.Series([x.min(),x.max()],index=['min','max'])
Press F9 to run the line, it returns "SyntaxError: unexpected EOF while parsing". If in the second line, it returns "SyntaxError: 'return' outside function".
In addition, I also tried to put "\"s at the end of each line. It doesn't work either. And find from webpages that if the lines end with : or , then you don't need \ to split.
But!!! if I deleted the 'Enters' and put everything in a single line without splits, it works well totally.
Why my python cannot work with code blocks? How can I fix it with Anaconda3?
Thank you so much~~~~
The problem is that you need to select the entire function before pressing F9, if you select only a part of it it will raise an error
You can use \ at the end of each line to tell Python that the line continues below:
data = {\
'state':['Ohio','Ohio','Ohio','Nevada','Nevada','Nevada'],\
'year':[2000,2001,2002,2001,2002,2003],\
'pop':[1.5,1.7,3.6,2.4,2.9,3.2]\
}
Having the dictionary split across multiple lines may look pretty, but it is not proper syntax. I've also been tripped up by tutorials that show their dictionaries like that :|
This may not work in interpreters other than IDLE.
in Jenkins file one of the variable is having the comma separated values like below.
infra_services=[abc,def,xyz]
when I write the below code it was throwing an error.
if ("{$Infra_Services}".contains("xyz"))
then
echo "$Infra_Services"
fi
yes you can do if statements in a Jenkinsfile. However if you are using declarative pipeline you need to brace it with the step script.
Your issue comes from the fact you did not put any double quotes around "abc" and all the elements of your array
infra_services=[abc,def,xyz]
β
A second error will raise after you fix this. If infra_services is an array, to manipulate it you should not try to cast it as string. It should throw when you do "{$Infra_Services}"
here is a working example
βdef Infra_Services = ["abc","def","xyz"]
if (Infra_Services.contains("xyz")) {
println "found"
}ββ
My advice is to test your groovy before running it on jenkins, you will gain precious time. Here is a good online groovy console I use to test my code. running the groovy console from terminal is an alternative
https://groovyconsole.appspot.com/
So, I try to use plugin https://wiki.jenkins-ci.org/display/JENKINS/URLTrigger+Plugin.
I want to trigger my Jenkins job when the text "Last build (#40), 17 hr ago" in the response of provided URL is changed (build number will be different after each build).
So I made following configurations:
1. Build trigger: Set [URLTrigger] - Poll with a URL.
2. Specified URL to another Jenkins: http://mydomain:8080/job/MasterJobDoNothing/
3. Set Inspect URL content option
4. Set Monitor the contents of a TEXT response
5. Set following regular expression: ^Last build[.]*
6. Set Schedule every minute: * * * * *
7. Trigger the job on another Jenkins
Actual result: My job wasn't triggered.
Then I tried to deal with XML/XPath and specify
8. Set Monitor the contents of an XML response
9. Set XPath: //*[#id="side-panel"] (also tried with one "/")
Actual result: the same.
Tell me please what I'm doing wrong? Please provide examples of RegEx or XPath if possible.
Thanks, Dima
I managed to trigger reliably with regex setting.
The regex pattern matches each line of the input.
No need to use ^ or $. it always match line start to line end.
This plugin compares the contents of the matched lines. It triggers if different.
This plugin compares the count of the matched lines. It triggers if the count is different.
This plugin uses matches() method of java.util.regex.Matcher. So the regex pattern should conform to it. (it's fairly normal regex)
As for your example,
Last build.*
may work.
Refs:
Reference of regex patten:
http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
Reference of Matcher: http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#matches()
The regex trigger source code:
github.com/jenkinsci/urltrigger-plugin/blame/master/src/main/java/org/jenkinsci/plugins/urltrigger/content/TEXTContentType.java
I'd recommend to use the "RSS for all" link as a trigger URL instead, and /feed/entry[1] as the XPath expression for the XML response content nature.
PS: I was using PathEnq to debug the XPath expression.
I'm using the Vim Latex Suite, and I love it. But there are some points in which it doesn't do what I want.
From the .vim/compiler/tex.vim file:
" Depending on the 'ignore-level', the following kinds of messages are
" ignored. An ignore level of 3 for instance means that messages 1-3 will be
" ignored. By default, the ignore level is set to 4.
"
" 1. LaTeX Warning: Specifier 'h' changed to 't'.
" This errors occurs when TeX is not able to correctly place a floating
" object at a specified location, because of which it defaulted to the
" top of the page.
" 2. LaTeX Warning: Underfull box ...
" 3. LaTeX Warning: Overfull box ...
" both these warnings (very common) are due to \hbox settings not being
" satisfied nicely.
" 4. LaTeX Warning: You have requested ...,
" This warning occurs in slitex when using the xypic package.
" 5. Missing number error:
" Usually, when the name of an included eps file is spelled incorrectly,
" then the \bb-error message is accompanied by a bunch of "missing
" number, treated as zero" error messages. This level ignores these
" warnings.
" NOTE: number 5 is actually a latex error, not a warning!
This list doesn't mention anything about missing packages. This can be noticed when compiling a Tex file that has a \usepackage which isn't on the system.
normally one would get the error (when adding `\usepackage{notapackage}:
! LaTeX Error: File `notapackage.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
But in vim, since this type of error isn't supported, I get:
As you can see nothing is said about a missing package, just an cryptic emergency stop
Another problem is that when an unknown option is passed to a package, Vim opens up that packages .sty file, which can be mighty irritating.
How do I make vim recognize this error?
I see nothing wrong with the error you are getting. Remember, that vim does not know anything about latex. All the messages that you see are what the latex compiler spits out (which in turn, does not know about vim). All that the vim-latex-suite does is display the output neatly in a vim buffer/window for easy reading/fixes.
Secondly, I think that you are just seeing the last part of the error message in the Quickfix/log window and if you scroll up, you should see the correct message. Here's an explanation of what you're seeing and the different modes of compilation.
Non-stop mode
In this mode pdflatex (or latex) compiles without stopping for warnings/errors, which is useful because I don't really want to pause and hit enter at each step. Judging by the error message you have, this is the mode you are running it in. The location where this mode is set is in ~/.vim/ftplugin/tex.vim especially, the following line:
let g:Tex_CompileRule_pdf = 'pdflatex -interaction nonstopmode $*'
To demonstrate, here's a test example that I compiled
\documentclass{article}
\usepackage{notapackage}
\begin{document}
Hello world
\end{document}
The message I get is:
At first, it looks like what you have, but note that they're at lines 42-47. Scrolling up a few lines, you'll find:
There is no way to halt it in this mode (that's why it's called nonstop mode!), and this is the behaviour you see if you ran it from the terminal.
Interactive mode
In this mode it pauses for each error and gives you a chance to correct it (if possible). This is useful in large projects (i.e. books running into pages with lots of equations + floats) where the compile time is longer and you'd rather pause to fix than recompile from the start.
If you turn off the nonstop mode by setting
let g:Tex_CompileRule_pdf = 'pdflatex $*'
and then try to compile, vim will take you to the terminal, where you can enter a new name for the package at the prompt. Since it is a simple example, to see the changes visually after entering a new package, I entered palatino at the prompt. This should compile the PDF and display "Hello world" in Palatino font, and indeed it does! (Palatino is on the left and the default CM is on the right).
However, I really wouldn't recommend this mode if you, like me, are just using latex for your school/math/cv work. It'll quickly get frustrating.