Can't resolve incompatible character encoding in Jenkins - jenkins

I am attempting to run a Cucumber (Ruby 2.3) Test Suite from Jenkins that tests whether or not 2-4 byte UTF-8 characters are valid names for groups.
I have tried a number of solutions and have been searching for days attempting to find an issue relevant to mine.
The error that has been haunting me is:
incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
Which refers to a line where I am attempting to send an ssh command to the CLI on the machine I am creating the group on:
$mymachine.cli_ssh.exec!("config group create --name='#{group_name}'")
Where within the exec!() command exists:
command.force_encoding("UTF-8")
The error only occurs when I am sending 2-4 byte UTF-8 characters, such that:
Group 'abcd' does not cause the error
and
Group 'ЯЯЯ' does cause the error
The problem:
Running this script on my local Ubuntu machine works perfectly fine (Ruby 2.2.1), as well as other machines in my area. (which is why I do not think it is necessary to provide more code than is given). I know there was a change in encoding to UTF-8 with the jump to Ruby 2.0 but both machines are past that, so I don't think that is the issue.
I have already tried establishing system locales on the Jenkins machine as en_US.UTF-8 both as locale system variables and within the /.bashrc file. No where have I seen an encoding variable set to ASCII-8BIT.
I have also tried exporting the system locales from the Jenkins shell prior to the script's execution.
I am in need of some answer, or some direction that can help me resolve this issue.

The issue was resolved by updating all Ruby gems on the Jenkins system. It is likely that certain gems were out of date even though they were technically compatible with the version of Ruby the Jenkins machine was running, and therefor, there could have existed Ruby code that was non-UTF8.
If you run into this issue in the future, I would recommend ensuring that all gem and ruby versions are consistent between your Jenkins machine and the working machine.

Related

RuboCop 'Layout/EndOfLine: Carriage return character detected' WSL2

I'm currently developing for a Ruby on Rails application. I am on a windows machine, using ubuntu through WSL. We have rubocop setup to track formatting on git pushes, and I always run into the same issue. When adding this comment to the top of any file, I receive the error Layout/EndOfLine: Carriage return character detected. The issue seems to be talked about here as well Layout/EndOfLine: Carriage return character detected. module TieConnector
# frozen_string_literal: true
The solution here seems to be to disable the warning, or manually convert the files before pushing.
Does anyone know if there is another solution here? I don't believe I can edit the rubocop settings as it is not my project. The converting method does work, but gets a bit tedious to do every time I make a new pull request.
Would there be a way to run the dox2unix convert when running git push while targeting the files staged for commit? Or a way to force my machine to use the unix encoding by default?
Any help is appreciated, thank you
It's a common issue on windows. If you are using vscode you can convert all your files to LF with this shortcut: ctrl + shift + P => 'change all end of line sequence' => Enter => Enter => Enter => 'LF' => Enter Then you can commit and push your code. If it still don't work you might see your git configuration, autocrlf in particular. See this response: stackoverflow.com/a/20653073/7542830
To solve it on a repository level:
git config --local core.autocrlf input (on you project root)
I'm using RubyInstaller2 (MSYS2 backend, not WSL) and ran into the same issue when RuboCop made some fixes (apparently is used CRLF instead of LF).
I fixed all the files in vim with :bufdo %s/\r//, but still got the error as the first character was still a CR (or CRLF).
Had to end up using dos2unix, as recommended in Layout/EndOfLine: Carriage return character detected. module TieConnector
[EDIT]: Error is intermittent on Windows due to missing BOM: https://github.com/rubocop/rubocop/issues/4669

Unable to run 'tcl' file on Vivado 2016.4 version

I am trying to run a .tcl file originally configured for 2014.4 on 2016.4 version of Vivado. However I am getting the following error:
while executing
"create_bd_cell -type ip -vlnv xilinx.com:ip:mig mig_0 "
(procedure "create_root_design" line 111)
invoked from within
"create_root_design """
(file "all.tcl" line 405)
The tcl file uses the part 'xcku040-ffva1156-2' and tries to access the IP 'mig' which I believe is renamed/changed on later versions. Is there any workaround for this?
Steps I have done till now:
Changed the version number to 2016.4
tried replacing target boards.
tried on the same board with an alternate IP for mig.
tried on both 2016.4 and 2015.4 versions
None of these have worked so far
Attaching the '.tcl' file for reference : all.tcl
Since with every version upgrade of the Vivado Design Suite, parts are renamed or removed, it is not possible to run a .tcl file meant for an earlier version in newer releases. So I ran the above query on Xilinx Community Forums and found a workaround:
Run this script on the previous version(2014 in this case), generate the design and then open the same design using the next major release(2015 version). The 2015 version will automatically suggest upgrades to the discontinued/renamed IPs. Repeat the same to get to 2016 version. That's the only way to get this done. Also have to keep checking if the core functionality of the IP is the same after automated upgrades by Vivado Design Suite.

Running Groovysh in Grails Application does not accept input

I'm trying to find a Pry Deubgger equivalent on Groovy.
I found a good enough project named groovy-debugger and updated it's dependencies to run against groovy 2.3.1 which comes with Grails 2.4.0.
If I open a groovysh just a blinking cursor will be shown which does not accept any input.
I tried to get the input stream and output stream of a current grails console, but it does not help.
Anyone can help me setup my beloved REPL-driven development environment on Groovy.
So using Grails 2.4.0 I created a new project and started the shell with grails shell and it was able to accept input with no problem. This is with Mac OS X. What operating system are you running?

Resolving Address Space is already occupied error using Cygwin and Ruby

I keep getting the same type of error messages and I have really done all I can to get rid of them. The message is as follows, only the module can vary at times:
ruby 5740 child_info_fork::abort: address space needed by 'date_core.so' (0x600000) is already occupied
These messages occur at various times when trying to run Rails, such as “rails console”.
I am running the following environment:
Windows 7 Ultimate 64-bit
Cygwin Net using setup 2.774 (installed from Internet mirrors)
Ruby 1.9.3p392
Rails 3.2.11
I have taken the following steps attempting to fix this:
Deleted all BLODA and restarted, including Norton 360 and Malwarebytes. (BLODA is Big List of Dodgy Apps.)
Deleted and reinstalled Cygwin.
Executed “rvm implode” and rebuilt the RVM and Ruby on Rails environment.
Used CMD & ASH to run “peflagsall” & “rebaseall”. Ran “rubyrebase”. Restarted.
Used FIND to build a file of all *.so & *.dll files. Ran “rebase -T”. Restarted. This has also been done using the “-b 0x77000000” switch.
Used same file to create “to_peflags” script issuing peflags against each individual file. Restarted.
All repair attempts have been futile. At times, “rebase -si |grep ‘*’” would be clean. Any attempt to run “rails console” or similar commands results in Address Space Occupied messages. Subsequent “rebase -si” would then again show conflicts.
I have been trying to run “peflags” against the Ruby modules, but I only get “skipped because could not open” error messages there. File permissions and ACL both show correct permissions. The same error occurs whether or not Administrator is used.
This is pretty frustrating. I would like to fix my current environment, but I am considering moving to MSYS or SFU, but I don’t know if either of those are decent options. I am also considering going native UNIX, but I’ll leap off the cliff when I get to it.
For now, does anyone have a fix for this specific error for me? Thanks…
I have used procexp to monitor "rails console" execution. Bash is calling cmd.exe to run the rails.bat file. Cmd.exe runs in ASLR mode. Used Microsoft EMET 3.0 to turn off mandatory ASLR and bottom up ASLR for both bash and cmd. Cmd.exe still runs in ASLR mode. It must be compiled that way.
Updated registry to set HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\MoveImages to 0, -1 then 1. 0 caused system problems. -1 had no effect. 1, which was supposed to be the default, helped somewhat as long as EMET changes were in place. But, it was unreliable as Address Space Occupied would eventually recur.
Decided to attempt to install a command processor that either didn’t require ASLR or allowed me to disable it using PE flags. I installed TCC/LE and attempted to get Cygwin Bash to use it to process .bat files. I tried using the path variable, the COMSPEC variable and changes to batfile and cmdfile in the registry all to no effect. Cygwin Bash must either have it hard coded or some nonobvious control.
My fix is to replace my environment. I know I will eventually migrate to some Unix, but for now I am converting to MinGW/MSYS and RubyStack. All I want to do is to get a stable RoR (Ruby on Rails) environment running for today. I don’t see that happening using Cygwin with Windows 7 Ultimate. I keep running into too many problems and this one is a very, very tough nut to crack. Thanks…

Installing RubyMine on Windows 7 persistent error: "Could not find "README" in any of your source paths."

I installed ruby 1.9.3 w/ rubyinstaller-1.9.3-p194.exe, and then installed RubyMine right after, as per directions:
http://www.jetbrains.com/ruby/quickstart/index.html
and
http://rubyinstaller.org/
I have git hub for windows already installed which I don't know if that could cause the problem.
I have also installed ruby and rails several times but I looked through the PATH environment variable for any no longer existing installations and removed them (after having already had this error) which didn't help.
Here are the settings I select in RubyMine.
The error message:
"C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin/rails 3.2.6 new "D:/Program Files (x86)/Git/Rails App/asfasf" --skip-test-unit --javascript=jquery --skip --database=postgresql
exist D:/Program Files (x86)/Git/Rails App/asfasf
Could not find "README" in any of your source paths. Your current source paths are:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.6/lib/rails/generators/rails/app/templates
Process finished with exit code 1"
I apologize if I come across as angry / frustrated (I edited this several times to remove it) as I have been trying to get RubyMine to work on Windows 7 or Ubuntu 12.04 and neither have been successful.
Any advice would be greatly appreciated!
I continued searching through the web for information and remembered somewhere installing rails on windows previously that for some reasons files couldn't have spaces in them.
Long story short: make sure your path doesn't have spaces in the name because it breaks rubymine or rails or something along the way.
Changing my project folder to a destination with no spaces solved the problem.

Resources