Azure Pipeline failed for maven app engine deploy - maven

I have been trying to deploy my app engine app from azure pipeline now.
I was able to make mvn clean and package it but when i used mvn appengine:deploy it does throw this permission issue. I got through some common questions like this:
I cant init Google Cloud SDK on Ubuntu
and
gcloud components update permission denied
What I did, I added the script tag before my maven in yml file.
- script: |
sudo chown -R $USER /home/vsts/.config/gcloud/config_sentinel
- task: Maven#3
displayName: 'Maven api/pom.xml'
inputs:
mavenPomFile: 'api/pom.xml'
goals: 'clean package appengine:deploy'
But not sure what is the issue and which else permission i need to set my USER for pipeline is vsts here. Please let me know if i made any mistake so far.
Error log from the pipeline is below for reference:
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/guava/guava/27.0-jre/guava-27.0-jre.jar (2.7 MB at 3.4 MB/s)
Nov 06, 2019 6:51:59 PM com.google.cloud.tools.managedcloudsdk.install.Downloader download
INFO: Downloading https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz to /home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/downloads/google-cloud-sdk.tar.gz
Welcome to the Google Cloud SDK!
WARNING: Could not setup log file in /home/vsts/.config/gcloud/logs, (IOError: [Errno 13] Permission denied: u'/home/vsts/.config/gcloud/logs/2019.11.06/18.52.02.245238.log')
Traceback (most recent call last):
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/bootstrapping/install.py", line 225, in <module>
main()
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/bootstrapping/install.py", line 200, in main
Prompts(pargs.usage_reporting)
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/bootstrapping/install.py", line 123, in Prompts
scope=properties.Scope.INSTALLATION)
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 2269, in PersistProperty
named_configs.ActivePropertiesFile.Invalidate(mark_changed=True)
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/configurations/named_configs.py", line 413, in Invalidate
file_utils.WriteFileContents(config.Paths().config_sentinel_file, '')
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/util/files.py", line 1103, in WriteFileContents
with FileWriter(path, private=private) as f:
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/util/files.py", line 1180, in FileWriter
return _FileOpener(path, mode, 'write', encoding='utf8', private=private)
File "/home/vsts/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/util/files.py", line 1208, in _FileOpener
raise exc_type('Unable to {0} file [{1}]: {2}'.format(verb, path, e))
googlecloudsdk.core.util.files.Error: Unable to write file [/home/vsts/.config/gcloud/config_sentinel]: [Errno 13] Permission denied: '/home/vsts/.config/gcloud/config_sentinel'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.958 s
[INFO] Finished at: 2019-11-06T18:52:02Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:2.0.0:deploy (default-cli) on project configuration-api: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:2.0.0:deploy failed: com.google.cloud.tools.managedcloudsdk.command.CommandExitException: Process failed with exit code: 1 -> [Help 1]

As requested, posting my yaml file which may help few to solve the same problem.
Now I given the permission to the parent directory which is gcloud one, as I shown other directories were giving issue.
- script: |
sudo chown -R $USER:$USER /home/$USER/.config/gcloud/
- task: Maven#3
displayName: 'Maven api/pom.xml'
inputs:
mavenPomFile: 'api/pom.xml'
goals: 'clean package appengine:deploy'
I uses $USER to make it for all. As I used Azure maintained Agent my pipeline user was vsts which picked up automatically. And would help others irrespective of their user.
if any more help required let me know thanks.

Related

Aws elastic beanstalk 'try add execution permission' prebuild hooks error

My eb-engine.log file says the following:
2022/12/02 09:06:55.661307 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2022/12/02 09:06:55.661326 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2022/12/02 09:06:55.661362 [INFO] Following scripts will be executed in order: [00_npm_install.sh]
2022/12/02 09:06:55.661368 [INFO] Try add execution permission
2022/12/02 09:06:55.661375 [INFO] Running script: .platform/hooks/prebuild/00_npm_install.sh
2022/12/02 09:07:19.325093 [ERROR] An error occurred during execution of command [app-deploy] - [RunAppDeployPreBuildHooks]. Stop running the command. Error: Command .platform/hooks/prebuild/00_npm_install.sh failed with error exit status 244.
I do have permissions set up for the file(s) in question:
$ git ls-files -s .platform
100755 e8c201d7464dcf52ae874bb106de1a0da6a7bd20 0 .platform/confighooks/prebuild/00_npm_install.sh
100755 e8c201d7464dcf52ae874bb106de1a0da6a7bd20 0 .platform/hooks/prebuild/00_npm_install.sh
100644 7744deea7dfdafe4f584e01991cb6e80ee3079b9 0 .platform/nginx/conf.d/proxy.conf
But this error occurs anyway ever since I committed (using github desktop) and pushed from a new device, which was an update that did not tweak my files. Before that commit & push, the output was the following:
2022/11/30 18:56:18.539468 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2022/11/30 18:56:18.539488 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2022/11/30 18:56:18.539521 [INFO] Following scripts will be executed in order: [00_npm_install.sh]
2022/11/30 18:56:18.539527 [INFO] Try add execution permission
2022/11/30 18:56:18.539535 [INFO] Adding execute mode to file, original mode is 436
2022/11/30 18:56:18.539543 [INFO] Running script: .platform/hooks/prebuild/00_npm_install.sh
2022/11/30 18:56:32.415210 [INFO] Finished running scripts in /var/app/staging/.platform/hooks/prebuild
Does anyone know what could have changed or how to fix this?
It turns out something was wrong with my configuration of EB, it later also stopped giving me logs when I requested them. I set up some new configuration and after the environment was rebuilt, everything worked again.

#QuarkusIntegrationTest : Unable to determine the status of the running process. See the above logs for details

I'm currently learning Quarkus and I have an issue with Native testing.
In this repository (the dev branch), I can package into JAR and binary and run them ([AdinhLux/quarkus-1-intro][https://github.com/AdinhLux/quarkus-1-intro/tree/dev]).
I'm just encountering an issue when running the below command line. It seems my Maven was looking for an information into .target/quarkus.log but nothing is written.
mvn verify -Pnative
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.agoncal.quarkus.starting.BookResourceIT
Jul 20, 2022 4:48:58 PM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 3.4.2.Final
Executing "/Users/adinhlux/development/IntelliJProjects/rest-book/target/rest-book-1.0.0-SNAPSHOT-runner -Dquarkus.http.port=8081 -Dquarkus.http.ssl-port=8444 -Dtest.url=http://localhost:8081 -Dquarkus.log.file.path=/Users/adinhlux/development/IntelliJProjects/rest-book/target/quarkus.log -Dquarkus.log.file.enable=true"
Waited 60 seconds for target/quarkus.log to contain info about the listening port and protocol but no such info was found
[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 61.737 s <<< FAILURE! - in org.agoncal.quarkus.starting.BookResourceIT
[ERROR] org.agoncal.quarkus.starting.BookResourceIT.shouldCountAllBooks Time elapsed: 0.012 s <<< ERROR!
java.lang.RuntimeException: java.lang.IllegalStateException: Unable to determine the status of the running process. See the above logs for details
I'm running my project on macOS Monterey M1 with the following settings :
sdk install java 17.0.4-oracle
brew install --cask graalvm/tap/graalvm-ce-java17
sdk install maven 3.8.6
sdk install quarkus 2.10.2.Final
xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.1.0/Contents/Home
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
export PATH=$JAVA_HOME/bin:$PATH
cd $JAVA_HOME/bin
gu install native-image
I resolved my issue .
In application.properties you need this :
quarkus.log.category."org.agoncal".level=DEBUG

go application build with bazel can't link when running inside container

I am trying to containerize my application build, though, when running the build that uses bazel with bazel-gazelle inside a container I will get this error:
$ bazel run --spawn_strategy=local //:gazelle --verbose_failures
INFO: Analyzed target //:gazelle (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/BUILD.bazel:43:15: GoToolchainBinary external/go_sdk/builder [for host] failed: (Exit 1): go failed: error executing command
(cd /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/execroot/__main__ && \
exec env - \
GOROOT_FINAL=GOROOT \
external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a)
# Configuration: e0f1106e28100863b4221c55fca6feb935acec078da5376e291cf644e275dae5
# Execution platform: #local_config_platform//:host
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
Target //:gazelle failed to build
INFO: Elapsed time: 2.302s, Critical Path: 0.35s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
I tried to run it standalone:
$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument
and still got no success.
Never had this kind of link problem and the linker don't provide much more information. Tried to install all packages I could think of and still no luck.
For context:
Running Ubuntu 20.04 LTS
Docker 20.10.9
Bazel 4.2.2
Rules GO v0.31.0
Bazel Gazelle v0.25.0
Also tried to run it with the strace, though I don't think I am skilled enough to find meaningful information from the tool output.
#edit
For more context:
e$ /home/workstation/.cache/bazel/_bazel_workstation/fb227af4c7b6aa39cc5b15d7fd9b737a/external/go_sdk/bin/go tool link -v -o bazel-out/host/bin/external/go_sdk/builder bazel-out/host/bin/external/go_sdk/builder.a
HEADER = -H5 -T0x401000 -R0x1000
searching for runtime.a in /opt/go/pkg/linux_amd64/runtime.a
/opt/go/pkg/tool/linux_amd64/link: mapping output file failed: invalid argument

Yandex-Tank unable to run JMeter - Unable to access to JMeter executable file or it does not exist

I'm trying to start JMeter from Yandex.Tank in Yandex Cloud instance, based on Ubuntu 18.
Installed JMeter here: /home/tank/apache-jmeter-5.2.1/bin/jmeter
If I run JMeter using this path it starts successfully:
/home/tank/apache-jmeter-5.2.1/bin/jmeter -n -t ReloadTest.jmx -l result-1.jtl -e -o ./result-1
When I run yandex-tank, there is an error message:
[ERROR] Test interrupted:
<type 'exceptions.RuntimeError'>: Unable to access to JMeter executable file or it does not exist:
/home/tank/apache-jmeter-5.2.1/bin/jmeter
load.yaml:
phantom:
enabled: false
jmeter:
enabled: true
jmx: ReloadTest.jmx
buffered_seconds: 10
jmeter_path: /home/tank/apache-jmeter-5.2.1/bin/jmeter
jmeter_ver: 5.2
ext_log: all
overload:
enabled: true
package: yandextank.plugins.DataUploader
token_file: "token.txt"
Tried this, without success:
chmod +x /home/tank/apache-jmeter-5.2.1/bin/jmeter
chmod 777 /home/tank/apache-jmeter-5.2.1/bin/jmeter
I cannot reproduce your issue using latest YandexTank 1.12.8.1, you might want to update your current installation using pip like:
pip install https://api.github.com/repos/yandex/yandex-tank/tarball/master
If will still be experiencing problems - run YandexTank with -v command-line argument, it should produce more verbose debug messages so you will be able to figure out where the problem lives
2020-03-16 09:45:38,960 [DEBUG] yandextank.core.tankcore tankcore.py:267 Starting <yandextank.plugins.JMeter.plugin.Plugin object at 0x7fe01d57a090>
2020-03-16 09:45:38,968 [INFO] yandextank.plugins.JMeter.plugin plugin.py:119 Starting /home/tank/apache-jmeter-5.2.1/bin/jmeter with arguments: ['/home/tank/apache-jmeter-5.2.1/bin/jmeter', '-n', '-t', '/modified_s7ZsHU.jmx', '-j', '/logs/2020-03-16_09-45-22.748390/jmeter_0vPrFi.log', '-Jjmeter.save.saveservice.default_delimiter=\\t', '-Jjmeter.save.saveservice.connect_time=true']
2020-03-16 09:45:50,632 [WARNING] yandextank.plugins.JMeter.plugin plugin.py:188 JMeter UDP port wasn't discovered
2020-03-16 09:45:50,635 [INFO] yandextank.core.tankcore tankcore.py:271 Plugin <yandextank.plugins.JMeter.plugin.Plugin object at 0x7fe01d57a090> required 11.666250 seconds to start
2020-03-16 09:45:50,637 [DEBUG] yandextank.core.tankcore tankcore.py:267 Starting <yandextank.plugins.RCAssert.plugin.Plugin object at 0x7fe01d5059d0>
2020-03-16 09:45:50,640 [INFO] yandextank.core.tankcore tankcore.py:271 Plugin <yandextank.plugins.RCAssert.plugin.Plugin object at 0x7fe01d5059d0> required 0.000021 seconds to start
2020-03-16 09:45:50,647 [DEBUG] yandextank.core.tankcore tankcore.py:267 Starting <yandextank.plugins.Telegraf.plugin.Plugin object at 0x7fe01d505110>
2020-03-16 09:45:50,650 [DEBUG] yandextank.plugins.Telegraf.plugin plugin.py:62 load_start_time = 1584351950.65
2020-03-16 09:45:50,655 [INFO] yandextank.core.tankcore tankcore.py:271 Plugin <yandextank.plugins.Telegraf.plugin.Plugin object at 0x7fe01d505110> required 0.005424 seconds to start
2020-03-16 09:45:50,659 [DEBUG] yandextank.core.tankcore tankcore.py:267 Starting <yandextank.plugins.ResourceCheck.plugin.Plugin object at 0x7fe01d505c50>
2020-03-16 09:45:50,664 [INFO] yandextank.core.tankcore tankcore.py:271 Plugin <yandextank.plugins.ResourceCheck.plugin.Plugin object at 0x7fe01d505c50> required 0.000014 seconds to start
2020-03-16 09:45:50,666 [INFO] yandextank.core.tankcore tankcore.py:279 Waiting for test to finish...
You can also try to change the ownership of the whole JMeter folder to the tank user like:
chown -R tank /home/tank/apache-jmeter-5.2.1
And finally, you can consider switching to Taurus tool which better supports JMeter and is capable of automatically downloading JMeter with plugins so you won't have to worry about installing JMeter. Check out Navigating your First Steps Using Taurus article for more details.

Unable to build Adhoc distribution from command line

I am trying to script the IPA creation process for Appcelarator Alloy project with grunt using the grunt-appc-cli plugin.
My target config looks like below:
'dist-prod': {
'command': "run",
'args': [
'-p', 'ios',
'-T', 'dist-adhoc',
'-R', '<Dev Cert Name>',
'-P', '<Provisioning Profile UUID>',
'-O', './dist/prod/',
'--log-level', 'trace'
]
},
Running this grunt target gets stuck at following:
>> [INFO] JavaScript files need to be encrypted
>> [INFO] Creating Xcode project
>> [TRACE] Removing pre-compile phase
>> [TRACE] Adding 3 native module libraries
>> [TRACE] No extensions to add
>> [INFO] Creating Entitlements.plist
>> [INFO] Creating Info.plist
>> [INFO] Disabling ATS
>> [INFO] Creating main.m
>> [INFO] Creating Xcode config files
>> [INFO] Copying Titanium libraries
>> [INFO] Copying Titanium iOS files
>> [TRACE] Skipping Classes/ApplicationRouting.m, it'll be processed later
After a while I have to Ctrl+C to kill without generating an IPA.
Any pointers to debug this issue?
**** More Info ****
I tried to run the appc run cmd directly and end up with the following error message:
$ appc run -p ios -T dist-adhoc -R "<Dev Cert Name>" -P "<Provisioning Profile UUID>" -O ../Svc --log-level trace
[ERROR] ** BUILD FAILED **
[ERROR] The following build commands failed:
[ERROR] CompileC build/Intermediates/FSM.build/Release-iphoneos/FSM.build/Objects-norm
al/armv7/TiUIiOSProxy.o Classes/TiUIiOSProxy.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[ERROR] (1 failure)
Make sure you are running on Xcode 7.3.1 and above and Titanium SDK 5.4 GA - That should address your problem.
Check more details here - https://jira.appcelerator.org/browse/TIMOB-23674
If you still see the problem with the above environment, please provide more details in the JIRA ticket.

Resources