Solaris 10 Bash redirect output to a file in wrong order - bash

i execute command :
groovy -cp SCRIPTS_DIR SCRIPTS_DIR/build.groovy >>output.txt 2>>error.txt
build.groovy file contains svn command and lot of mvn commands. During execution file output.txt is changing order and some rows are added in middle of output not at the end.
Example of output.txt:
Executing: svn export --revision 108 --force https://svn.server.eu:/svn/TEST/trunk 101
A /opt/eu/building/jenkins/workspace/test/101
A /opt/eu/building/jenkins/workspace/test/101/src
A /opt/eu/building/jenkins/workspace/test/101/src/scripts
A /opt/eu/building/jenkins/workspace/test/101/src/template
A /opt/eu/building/jenkins/workspace/test/101/src/template/tools
A /opt/eu/building/jenkins/workspace/test/101/MVN
A /opt/eu/building/jenkins/workspace/test/101/MVN/src
A /opt/eu/building/jenkins/workspace/test/101/MVN/src/main
A /opt/eu/building/jenkins/workspace/test/101/MVN/src/main/assembly
A /opt/eu/building/jenkins/workspace/test/101/common
A /opt/eu/building/jenkins/workspace/test/101/common/py
A /opt/eu/building/jenkins/workspace/test/101/PLAIN
A /opt/eu/building/jenkins/workspace/test/101/PLAIN/scripts
After few secunds when mvn commands are executed some of logs are between of rows related to svn export command:
Executing: svn export --revision 108 --force https://svn.server.eu:/svn/TEST/trunk 101
********************************************************************************
*** Check if root POM exists ***************************************************
********************************************************************************
*** Timestamp....................................: 30.03.2022 14:57:53
*** In minute since build start..................: 1
*** Root POM exists: MVN/pom.xml
********************************************************************************
*** Creating source.zip on Software Archive ************************************
********************************************************************************
*** Timestamp....................................: 30.03.2022 14:57:53
*** In minute since build start..................: 1
[zip] Building zip: /opt/eu/building/jenkins/workspace/test/source101.zip
********************************************************************************
*** Running resolve-props and lock-snapshots ***********************************
********************************************************************************
A /opt/eu/building/jenkins/workspace/test/101
A /opt/eu/building/jenkins/workspace/test/101/src
A /opt/eu/building/jenkins/workspace/test/101/src/scripts
A /opt/eu/building/jenkins/workspace/test/101/src/template
A /opt/eu/building/jenkins/workspace/test/101/src/template/tools
A /opt/eu/building/jenkins/workspace/test/101/MVN
A /opt/eu/building/jenkins/workspace/test/101/MVN/src
A /opt/eu/building/jenkins/workspace/test/101/MVN/src/main
A /opt/eu/building/jenkins/workspace/test/101/MVN/src/main/assembly
A /opt/eu/building/jenkins/workspace/test/101/common
A /opt/eu/building/jenkins/workspace/test/101/common/py
A /opt/eu/building/jenkins/workspace/test/101/PLAIN
A /opt/eu/building/jenkins/workspace/test/101/PLAIN/scripts
I execute this command on different linux systems and there output.txt is correct. Only on Solaris 10 i have this 'strange' behavior of stdout. Maybe it's related to output buffering but i'm not sure.
Any solution for this ?

Related

Gitlab CI not displaying complete output in terminal

I have created a pipeline which performs ansible-lint on $CI_PROJECT_DIR. The problem is the complete output is not shown in UI as compared to running on my local machine.
You can notice the difference in output for both.
Below is the output from my local machine (Ubuntu with ansible-lint installed)
**ansible-lint create-dir.yaml -v**
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: create-dir.yaml
INFO Executing syntax check on create-dir.yaml (0.31s)
WARNING Listing 1 violation(s) that are fatal
syntax-check: 'file' is not a valid attribute for a Play
create-dir.yaml:4:3 [WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! 'file' is not a valid attribute for a Play
The error appears to be in '/tmp/create-dir.yaml': line 4, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create a directory if it does not exist
^ here
Finished with 1 failure(s), 0 warning(s) on 1 files.
Below is output from Gitlab CI :
$ find ./ -not \( -name "*.ansible-lint" -o -name ".gitlab-ci.yml" \) \( -name "*yml" -o -name "*yaml" \) | xargs ansible-lint -v
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: ./ansible/create-dir.yaml
INFO Executing syntax check on ansible/create-dir.yaml (0.39s)
Cleaning up project directory and file based variables 00:01
Job succeeded
I would like to know why there is difference in output and how to print the complete message on Gitlab CI
Job logs in GitLab CI/CD have a limited length. It's designed for operational reasons, as the jobs can create arbitrary outputs so one could - by mistake or by purpose - output even gigabytes or terabytes of text.
But if you scroll up in the output, you have the abillity to view the full logs by pressing 'Complete Raw'.

Corrupted state.yml file on Ansible Molecule test

On running molecule to test my Ansible changes. I was receiving an error with the state.yml file. As shown:
$ molecule test
ERROR: while scanning a simple key
in "/tmp/molecule/my_module/default/state.yml", line 8, column 1
could not find expected ':'
in "/tmp/molecule/my_module/default/state.yml", line 9, column 1
ERROR: Job failed: exit status 1
It appears on the state.yml file had got corrupted on the remove gitlab runner some how. I deleted the file and re-ran the test job, and this passed.

Error while unzipping file on AIX system using CHEF

I want to un zip / un tar a file on AIX system using CHEF.
Steps i have done :
1.I have uploaded a zip file Test.zip on AIX system using Winscp.
2.Edited the default.rb using below command:
execute "extract_Test_tar" do
command "tar -xvf Test.zip"
cwd "/var/chef/cookbooks"
end
3.While uploading my cookbook it is giving me following error:
Recipe: Infy_Patrol::default
* execute[extract_Test_tar] action run
================================================================================
Error executing action `run` on resource 'execute[extract_Test_tar]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of tar -xvf Test.zip ----
STDOUT:
STDERR: tar: tape blocksize error
---- End output of tar -xvf Test.zip ----
Ran tar -xvf Test.zip returned 1
Resource Declaration:
---------------------
# In /.chef/local-mode-cache/cache/cookbooks/Infy_Patrol/recipes/default.rb
10: execute "extract_Test_tar" do
11: command "tar -xvf Test.zip"
12: cwd "/var/chef/cookbooks"
13: end
Compiled Resource:
------------------
# Declared in /.chef/local-mode-cache/cache/cookbooks/Infy_Patrol/recipes/default.rb:10:in `from_file'
execute("extract_Test_tar") do
action [:run]
retries 0
retry_delay 2
default_guard_interpreter :execute
command "tar -xvf Test.zip"
backup 5
cwd "/var/chef/cookbooks"
returns 0
declared_type :execute
cookbook_name "Infy_Patrol"
recipe_name "default"
end
Running handlers:
[2016-01-29T06:27:47-06:00] ERROR: Running exception handlers
Running handlers complete
[2016-01-29T06:27:47-06:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 05 seconds
[2016-01-29T06:27:47-06:00] FATAL: Stacktrace dumped to /.chef/local-mode-cache/cache/chef-stacktrace.out
[2016-01-29T06:27:47-06:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-01-29T06:27:47-06:00] ERROR: execute[extract_Test_tar] (Infy_Patrol::default line 10) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
REPHRASING MY QUESTION.
Below are the steps I followed :
1.Logged into my AIX machine.2.Logged into Winscp.
3.created a cookbook using : knife cookbook create Test
4.Using winscp i went to the path where my cookbook is saved:
/var/chef/cookbooks/Test 5.Opened recipes folder: and edited default.rb as given:
#
# Cookbook Name:: Infy_Patrol
# Recipe:: default
#
# Copyright 2016, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
tar_extract '/var/chef/cookbooks/Test.zip' do
action :extract_local
target_dir '/var/chef/cookbooks'
creates '/var/chef/cookbooks/new'
end
#Also tried the following piece of code
#execute "extract files" do
#command "tar xvf Test.tar.gz -C /var/chef/cookbooks"
#end
6.uploaded cookbook using :
chef-client -z -r Test::default
BUT IT IS GIVING ME AN ERROR :
Error executing action `run` on resource 'execute[extract_Test_tar]

Vowpal Wabbit: make test failing for me at test 59

For some reason I am having trouble with the make test statement while installing ```Vowpal Wabbit``. I am getting the following error:
RunTests: test 59: '/usr/bin/timeout 20 ../vowpalwabbit/vw -d train-sets/argmax_data -k -c --passes 20 --search_rollout oracle --search_alpha 1e-8 --search_task argmax --search 2 --holdout_off' failed (exitcode=1)
Anyone have a clue what this could be?
Just run the command which failed (in single quotes) directly from the test directory, and the reason would become obvious.
It is missing data file:
Reading datafile = test/train-sets/argmax_data
can't open: test/train-sets/argmax_data, error = No such file or directory
vw: std::exception
The issue was introduced in a recent check-in and should soon be fixed (hopefully).
Update (2014-05-31): fixed in the most recent commit.

Steps for installing Orbfit 4.2

I'm trying to install Orbfit4.2 on a using linux mint maya edition. I'm trying to follow the on line help. I have unzipped the tared file, configured with $ ./config -0 gfortran and then $ make. Both appears to be successful. I am now trying to create the DE405 data files in the /orbfit/src/jpleph directory. I have downloaded the header.405 and the ascp*date* ascii files into the directory from JPL. I have run $ make ephemerides and get the following;
cat header.405 ascp1960.405 ascp1980.405 ascp2000.405 ascp2020.405> input.430
asc2eph.x < input.430
/bin/sh: 1: asc2eph.x: not found
make: *** [ephemerides] Error 127
(I have also used input value of 405 instead of 430)
I have also tried just running from with in
the directory
$ ./asc2eph.x which was the previous method before the Makefile was included. All I get with this is 'authors' introductory message and the flashing working box-still running 6 hrs later.
If anybody has any experience or advice with installing Orbfit 4.2 from the start or can help me move on from the above blockage I would appreciate.
Note I am a real novice and would appreciate idiot step by step guide- I'm the idiot.
Eric
The Makefile assumes that the current directory "." is in your path. This is a security risk. You can either edit the Makefile to rename these binaries:
$ diff -u Makefile.orig Makefile
--- Makefile.orig 2014-01-09 07:14:10.000000000 -0800
+++ Makefile 2014-10-21 11:40:00.850236839 -0700
## -10,7 +10,7 ##
make clean
ephemerides: input asc2eph.x
- asc2eph.x < input.430
+ ./asc2eph.x < input.430
mv JPLEPH jpleph
make clean
Or you can add . to your path (but this is insecure!) by doing
$ PATH=.:$PATH

Resources