I've had this ExternalProject_Add call in my CMake:
set(SIM_URL https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip)
set(SIM_FILENAME vhnHilsimPlantModel-{build.number}.zip)
# Download and install
include(ExternalProject)
ExternalProject_Add(get_sim
DOWNLOAD_NAME ${SIM_FILENAME}
URL ${SIM_URL}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_BYPRODUCTS <INSTALL_DIR>/lib/sim_lib.a
STEP_TARGETS update)
It worked fine with the 2017 version of TeamCity. However, after our DevOps upgraded TeamCity to the 2019 version, this code started failing:
file='/home/user/sim/sim-prefix/src/vhnHilsimPlantModel-{build.number}.zip'
Old file will be removed and new file downloaded from URL.
-- Downloading...
dst='/home/user/build/apps/sim/sim-prefix/src/vhnHilsimPlantModel-{build.number}.zip'
timeout='none'
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retrying...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 5 seconds (attempt #2) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 5 seconds (attempt #3) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 15 seconds (attempt #4) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
-- Retry after 60 seconds (attempt #5) ...
-- Using src='https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip'
CMake Error at vahana_sim-stamp/download-vahana_sim.cmake:157 (message):
Each download failed!
error: downloading 'https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/vhnHilsimPlantModel-{build.number}.zip' failed
status_code: 22
status_string: "HTTP response code said error"
log:
--- LOG BEGIN ---
Trying 172.31.21.90...
The only way to fix it is to change { and } to %7B and %7D, respectively. This, technically should have been done in the first place, but it was working. Does anyone know why this change has to be done and/or why the non-ASCII characters have to be encoded when specifying the URL?
I am using CMake 3.10.2.
The TeamCity 9.X documentation for Obtaining Artifacts confirms that curly braces {build.number} could be used in the URL:
ARTIFACT_PATH is a path to the artifact on the TeamCity server. This path can contain a {build.number} pattern which will be replaced with the build number of the build whose artifact is retrieved.
However, this caused a few issues (one example here), as there are several reserved characters in the RFC's pertaining to URI/URL standards (in this case RFC 1738). The RFC 1738 standard deems a group of characters "unsafe" (including curly braces), in addition to the reserved characters for URIs:
Other characters are unsafe because
gateways and other transport agents are known to sometimes modify
such characters. These characters are "{", "}", "|", "", "^", "~",
"[", "]", and "`". [...] All unsafe characters must always be encoded within a URL.
Thus, the TeamCity software was updated thereafter to support the curly brace encodings as well. The TeamCity 10.X documentation for Obtaining Artifacts was updated to align with the standards for URL encoding:
ARTIFACT_PATH is a path to the artifact on the TeamCity server. This path can contain a {build.number} pattern (%7Bbuild.number%7D) which will be replaced by TeamCity with the build number of the build whose artifact is retrieved.
It seems that by the TeamCity 2019 versions, the support for using raw curly braces in the URL has been dropped altogether in alignment with the standard, and only the encoded version is allowed. So you can update your CMake code to something like this:
set(SIM_FILENAME vhnHilsimPlantModel-%7Bbuild.number%7D.zip)
set(SIM_URL https://teamcity.vh.com/guestAuth/rep/download/Sim_Feat/.lastSuccessful/${SIM_FILENAME})
Related
This question has been annoying me for a couple of years now!
What key needs to change to solve this ?
Background: ssh rsa keys of size 2048 can begin with leading 1 or 0. Leading 0 results in the key being seen as length 2047 to some software. These keys would appear to not conform to the standard so they are not accepted by the latest software libraries.
Older java versions and default crypto library used to allow the 2047 size rsa keys. Newer java does not. """java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 2047 is not supported""" is seen.
What we see is that when jenkins is upgraded then jobs where CVS access was working now do not work :-(
Without rebuilding jenkins to use different security libraries is it possible to solve this issue ?
Regenerating the CVS user key as RSA size 4096 was tried. Without success. Is it the CVS server host key which the error is about or is it the CVS user key ?
https://www.ssh.com/ssh/keygen/
ssh-keygen -t rsa -b 4096
Error can be solved by using different crypto libraries:
DH key size must be multiple of 64, and can only range from 512 to 2048 (inclusive)
2047 and 2048 RSA key length:
https://security.stackexchange.com/questions/90169/rsa-public-key-and-private-key-lengths
DHGEX failing with 2048-bit key under Java 8, but succeeding with 1024-bit key
Building in workspace /var/lib/jenkins/workspace/cvs_status_xxxxx
cvs checkout -P -D 15 Mar 2019 12:30:42 +0000 -d xxxxx xxxxx
ERROR: CVS Authentication failed: null
org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed.
at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:141)
at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.jcraft.jsch.JSchException: Session.connect: java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 2047 is not supported
at com.jcraft.jsch.Session.connect(Session.java:565)
at com.jcraft.jsch.Session.connect(Session.java:183)
at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:139)
... 2 more
ERROR: Cvs task failed
ERROR: Step ‘Archive the artifacts’ failed: No artifacts are configured for archiving.
You probably forgot to set the file pattern, so please go back to the configuration and specify it.
If you really did mean to archive all the files in the workspace, please specify "**"
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE
https://bugs.openjdk.java.net/browse/JDK-8164963
In RFC 2631 and FIPS 186-3/4 p can't have leading zeros. The JDK enforces this.
https://www.ietf.org/rfc/rfc2631.txt
It's outlined in this section of the RFC : "2.2.1.1. Generation of p, q"
I have tcl byte code on sharepoint with url like
https://share.abc.com/sites/abc/test.tcl
I want to source this file in another tcl file residing on my machine.
I don't want to copy the file from sharepoint.
Can anyone help me out here?
The source command only reads from the filesystem, but that can be a virtual filesystem. Thus, you can use the tclvfs package to make it so that HTTP sites can be mounted within the process, and then you can read from that.
# Add in HTTPS support
package require http
package require tls
::http::register https 443 ::tls::socket
# Mount the site; the vfs::urltype package won't work as it doesn't support https
package require vfs::http
# Double quotes only because of Stack Overflow highlighting sucking
vfs::http::Mount "https://share.abc.com/" /https.share.abc.com
# Load and evaluate the file
source /https.share.abc.com/sites/abc/test.tcl
This all assumes that you don't need any username/password credentials. If you do, you need to set them as part of the mount:
vfs::http::Mount "https://theuser:thepassword#share.abc.com/" /https.share.abc.com
Note that this currently requires that you're using HTTP Basic Auth (over HTTPS). That's sufficiently secure for almost any reasonable use.
This is quite a large stack of stuff. You can do it in rather less if you are willing to do some more of the work yourself:
package require base64
package require http
package require tls
::http::register https 443 ::tls::socket
proc source_https {url username password} {
set auth "Basic [base64::encode ${username}:${password}]"
set headers [list Authorization $auth]
set tok [http::geturl $url -headers $headers]
if {[http::ncode $tok] != 200} {
# Cheap and nasty version...
set msg [http::code $tok]
http::cleanup $tok
error "Problem with fetch: $msg"
}
set script [http::data $tok]
http::cleanup $tok
# These next two commands are effectively what [source] does (apart from I/O)
info script $url
uplevel 1 $script
}
source_https "https://share.abc.com/sites/abc/test.tcl" AzureDiamond hunter2
I have been learning how to use assetic filters and integrating compass/foundation5 through assetics. When I attempt to use assetic:dump I get a mess of errors and despite my best efforts I have yet to find the solution. First off I think the root of the error lies here.
Output:
error assetic_compassyGuG5K.scss (Line 13 of src/test/CoreBundle/Resources/public/scss/_settings.scss: File to import not found or unreadable: foundation/functions.
Load paths:
/tmp
/home/test/.rvm/gems/ruby-2.1.2/gems/compass-0.12.6/frameworks/blueprint/stylesheets
/home/test/.rvm/gems/ruby-2.1.2/gems/compass-0.12.6/frameworks/compass/stylesheets
/var/www/test.local/public_html/src/test/CoreBundle/Resources/public/scss
I have attempted to do anything I can think of to clear the error (aside removing the filter completely, which would fix it). I even attempted to use foundation to load the site and though I got rid of this error it was replaced by a error stating that the foundation.xml could not be located.
My question is do I need to add the config.rb to the filter to define the locations or am I missing something all together in the filter?
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: true
bundles: [ ]
#java: /usr/bin/java
filters:
cssrewrite: ~
compass:
bin: /home/nathan/.rvm/gems/ruby-2.1.2/bin/compass
apply_to: "/.scss$"
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
parameters:
assetic.ruby.bin: /home/nathan/.rvm/rubies/ruby-2.1.2/bin/ruby
The apply_to checks a regular expression, and \ indicates that the next character will be escaped (dot in this case), then, / should be replaced with \.
I'm working in Ubuntu and I want to use post-review to create a new review request for reviewboard with a manually-generated .diff file but failed.
I worked on post-review for most time of today but find myself stuck on this postbasedir problem. I asked three of my colleagues to sit on my seat to solve this problem but they too found themselves run out of effective solutions.
here is the problem:
I set repoistory and reviewboard_url in the .reviewboardrc file, I'm sure the two settings are ok because the request was successfully created in review board and the repository points to the directory where the target file resides.
here is the content of .reviewboardrc:
============================= .reviewboardrc ===============================
REVIEWBOARD_URL = "http://10.22.200.166:8088"
REPOSITORY = "http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk"
============================================================================
I run post-review as follows but failed on uploading the Doxyfile.diff file and here is the content of it:
============================== Doxyfile.diff ================================
Index: Doxyfile
===================================================================
--- Doxyfile (revision 107236)
+++ Doxyfile (working copy)
## -1,3 +1,5 ##
+#POST_REVIEW_TEST
+POST_REVIEW_TEST =
# Doxyfile 1.7.6
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
=============================================================================
and the output error message with debug info enabled
====================== err msg ===============================================
houchenxi#houchenxi-PC:~/renren-wap-talk$ post-review -dp --diff-filename=Doxyfile.diff
>>> RBTools 0.4.2
>>> Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1]
>>> Running on Linux-3.0.0-22-generic-x86_64-with-Ubuntu-11.10-oneiric
>>> Home = /home/houchenxi
>>> Current Directory = /home/houchenxi/renren-wap-talk
>>> Checking the repository type. Errors shown below are mostly harmless.
DEBUG:root:Checking for a CVS repository...
DEBUG:root:Checking for a ClearCase repository...
DEBUG:root:Checking for a Git repository...
DEBUG:root:Running: git rev-parse --git-dir
DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir']
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
---
DEBUG:root:Checking for a Mercurial repository...
DEBUG:root:Running: hg showconfig
DEBUG:root:Running: hg root
DEBUG:root:Command exited with rc 255: ['hg', 'root']
abort: no repository found in '/home/houchenxi/renren-wap-talk' (.hg not found)!
---
DEBUG:root:Checking for a Perforce repository...
DEBUG:root:Checking for a Plastic repository...
DEBUG:root:Checking for a Subversion repository...
DEBUG:root:Running: svn info http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk
DEBUG:root:Running: diff --version
DEBUG:root:repository info: Path: http://svn.d.xiaonei.com/wap, Base path: /renren/renren-wap-talk/trunk, Supports changesets: False
>>> Finished checking the repository type.
>>> HTTP GETting api/
>>> HTTP GETting http://ourhost:8088/api/info/
>>> Using the new web API
>>> HTTP GETting http://ourhost:8088/api/repositories/
>>> Attempting to create review request on http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk for None
>>> HTTP POSTing to http://ourhost:8088/api/review-requests/: {'repository': 'http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk'}
>>> Review request created
>>> Uploading diff, size: 335
>>> HTTP POSTing to http://ourhost:8088/api/review-requests/130/diffs/: {'basedir': '/renren/renren-wap-talk/trunk'}
>>> Got API Error 207 (HTTP code 400): The file was not found in the repository
>>> Error data: {u'stat': u'fail', u'file': u'/renren/renren-wap-talk/trunk/Doxyfile', u'err': {u'msg': u'The file was not found in the repository', u'code': 207}, u'revision': u'107236'}
Error uploading diff
Your review request still exists, but the diff is not attached.
==========================================================================
In the err msg above we found that the basedir parameter {'basedir': '/renren/renren-wap-talk/trunk'} is incorrect, which is supposed to be the full path from "http",namely "http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk" , but no matter how we try to modify the .reviewboardrc or add command line arguments, we just cannot correct this value to the expected right value, we searched in the help info by running "post-review --help", but there just isn't the "--basedir" option available.
All I have to do is to correct the basedir value to the correct full path , either by modifying the .reviewboardrc or changing post-review arguments.
Does anyone have any similar experience for solving this problem, and suggestion is highly appreciated.
I believe your problem may be the correlation between the path of the SVN repository:
http://svn.d.xiaonei.com/wap/renren/renren-wap-talk/trunk
and the relative path in your diff file (the level at which it was generated in the hierarchy of folders):
Index: Doxyfile
Unless the file Doxyfile is situated directly in the trunk, you should try to re-create your diff at such a level so that the diff will contain the missing relative path between the trunk and Doxyfile:
Index: /missing/path/to/Doxyfile
..or to update your SVN URL in Reviewboard so that the URL contains itself the missing path.
You will find a detailed explanation of this correlation in this answer for the post: review board diff not uploading
HTH!
I am seeing this error for quite sometime now.
I am running ant build on CYGWIN which inturn runs on WindowsXP.
The resolution(bad one) I found was to delete my gcct/first directory and run ant build again (which runs from another directory). It runs successfully but if I modify some code under gcct/first, I do not want to delete it because of this error.
I did see this link. The resolution here does not apply to me since I do not have .cvspass defined anywhere in the build.xml.
C:\svn\CEL_v3681\buildCore.xml:1883: cvs exited with error code 1
Command line was [Executing 'cvs' with arguments:
'checkout'
'-A'
'-rfirst_v2_126'
'gcct/first'
The ' characters around the executable and arguments are
not part of the command.
environment:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=C:/Apps/Apache/apache-ant-1.7.0
APPDATA=C:\Documents and Settings\shankarc\Application Data
CLASSPATH=./;C:/Program Files/Java/jre1.5.0_07/lib/ext/QTJava.zip
COMMONPROGRAMFILES=C:\Program Files\Common Files
COMPUTERNAME=NYKPWM2035798
COMSPEC=C:\WINNT\system32\cmd.exe
CUSTPROF=Roaming700Live
CVSROOT=:pserver:shankarc#amcvs2.lehman.com:/home/eqcvs/cmte
CVS_RSH=/bin/ssh
FP_NO_HOST_CHECK=NO
HOME=C:\Apps\CYGWIN\home\shankarc
HOMEDRIVE=F:
HOMEPATH=\
HOSTNAME=nykpwm2035798
IDEA_PROPERTIES=C:\Documents and Settings\shankarc\idea.properties
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:
JAVA_HOME=C:/Program Files/Java/jdk1.6.0_21/
JDK_HOME=C:\Program Files\Java\jdk1.6.0_21\
LOGONSERVER=\\NYKPSM00069
MANPATH=/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PATH=C:\Apps\CYGWIN\usr\local\bin;C:\Apps\CYGWIN\bin;C:\Apps\CYGWIN\bin;C:\Apps\CYGWIN\usr\X11R6\bin;C:\Apps\Apache\apache-ant-1.7.0\bin;C:\Program Files\Java\jdk1.6.0_21\bin\;C:\Apps\CYGWIN\bin;C:\Program Files\VisualSVN Server\bin;C:\Program Files\Sudowin\Clients\Console;C:\Program Files\Fortify Software\Fortify 360 v2.5.0\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
PRINTER=\\NYKPSM04020\NYKLPR1301-03-03C05
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f06
PROFGROUP=FONP
PROGRAMFILES=C:\Program Files
PROMPT=$P$G
PWD=/cygdrive/c/svn/CEL_v3681/gcct/cel
QHOME=c:\q
QTJAVA=C:\Program Files\Java\jre1.5.0_07\lib\ext\QTJava.zip
SESSIONNAME=Console
SHLVL=1
SITECODE=NYK
SITEIDENT=NYK
SVN_ASP_DOT_NET_HACK=1
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINNT
TEMP=C:\TEMP
TERM=cygwin
TMP=C:\TEMP
UATDATA=C:\WINNT\system32\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
USER=shankarc
USERDNSDOMAIN=INTRANET.BARCAPINT.COM
USERDOMAIN=INTRANET
USERNAME=shankarc
USERPROFILE=C:\Documents and Settings\shankarc
WINDIR=C:\WINNT
CVS_PASSFILE=C:\Apps\CYGWIN\home\shankarc\.cvspass]
Total time: 58 seconds
How I resolve this?
I had the same issue and found that even though I was not using .cvspass I did have a build property of cvs.pass set which needed to be reset to OVERRIDE to function depending on how you set up your cvs access (though it looked similar from your post). This needed to be changed in build.properties and .build.properties. Hope this helps!