Gradle Peer not authenticated OutOfMemoryError: PermGen space - exception

I have spent a lot of time with Android Studio 1.3 to be able to run a project. I faced so many problems so I want to put them here in one place so others can benefit from it and save their time.
Android peer not authenticated
Android Studio Gradle Issue: OutOfMemoryError: PermGen space
Gradle Could not HEAD https://..pom > peer not authenticated
I'll answer all those questions

Android Studio 1.3 (64bit) on Windows 8 (64bit)
1) Install Java 8 (64 bit) and Uninstall all other, remove paths of old java
2) go to cmd and type "java -version" it should print the 1.8 version information
3) Go to Environment Variables and define two variables
_JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
JAVA_HOME C:\Program Files\Java\jdk1.8.0_51
4) Open Android Studio (close project if any) Project Defaults -> Project Structure and set Java and Android Path
5) in your settings.gradle only include projects that you require e.g: include ':library-projects/android-az-progressbar', 'az-sample-trunk'
6) if you have huge project then you need to define those options under your project .gradle file android { dependencies {
dexOptions {
jumboMode true
incremental true
preDexLibraries false
javaMaxHeapSize "4g"
}
7) Now go to C:\Users\{your_user}\.gradle and make a new file named "gradle.properties"
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
org.gradle.daemon=true
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
# Enables new incubating mode that makes Gradle selective when configuring projects.
# Only relevant projects are configured which results in faster builds for large multi-projects.
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand
org.gradle.configureondemand=true
#org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m
8) Now Restart your computer and if needed Invalidate cache / restart your Android studio from file menu

Related

configuration options used in ubuntu 16 apache2 package

I want to compile Apache2 from source, making it like the ubuntu 16 package in all but one configuration option (version of openssl). How can I discover what options the package was built with?
apt-get source apache2 gets you the precise sources used to package it. Recompiling the package with one option changed would just require you to pass in that configuration option in the debian/rules file and repackage (though of course you should also do the usual motions to produce a unique local version number for the package).

Why is Google Cloud SDK (gcloud) trying to access a local MySQL instance?

I installed the Google Cloud SDK (gcloud) on my Windows workstation several weeks back. I noticed that every time I run a command, I saw output similar to:
MySQL: command not found
... before the normal command begins. I assumed that the SDK detected that I have MySQL installed on my workstation, and was trying (in a very buggy manner) to hook into it for Cloud SQL support. It was annoying, but I didn't pay it much attention.
Today I ran a gcloud components update command, and now the SDK is altogether non-functional. Apparently Google fixed the issue with the MySQL command's PATH, as the SDK is successfully invoking mysql.exe with every execution.
It's trying to connect with the MySQL user Utilities, and prompting me for a password. Of course I have no idea what the password is supposed to be, since I didn't create this user.
I went into MySQL Workbench and set the password for this user to a known value, so that I can get past the password prompt triggered by the SDK. However, the problem now is that any gcloud command that I type simply drops me into a MySQL shell session!
What the hell? I'm not sure why Cloud SDK is so insistent on accessing my local MySQL environment anyway. We do use Cloud SQL, but I have no particular interest in using gcloud to manage it (particularly if it's buggy). I can't remove the Cloud SQL component from my local environment right now... because once again, any gcloud command simply drops me into a MySQL shell. So I suppose my next step is to wipe the SDK off my workstation altogether, and attempt to install again without Cloud SQL selected. Why is any of this necessary at all?
UPDATE:
Blowing away my Cloud SDK enviroment and re-installing did not make the problem go away. However, removing mysql.exe from my system PATH did. Apparently, the current version of Cloud SDK simply breaks right now (at least on Windows) when it detects MySQL in your path. I wonder how this made it past QA?
The output from gcloud info is below (email address and current project ID redacted):
> gcloud info
Google Cloud SDK [0.9.67]
Platform: [Windows, x86_64]
Python Version: [2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)]]
Site Packages: [Disabled]
Installation Root: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk]
Installed Components:
core: [2015.06.30]
bq-win: [2.0.18]
core-win: [2015.06.02]
gcloud: [2015.06.30]
windows-ssh-tools: [2015.06.02]
gcutil-msg: [2015.06.09]
gsutil: [4.13]
bq: [2.0.18]
preview: [2015.06.30]
gsutil-win: [4.12]
System PATH: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\bin\sdk;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\Docker\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Steve\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Git\cmd;C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin;C:\PROGRA~2\Groovy\GROOVY~1.3\bin;C:\Users\Steve\.dnx\runtimes\dnx-coreclr-win-x86.1.0.0-beta5\bin;C:\Users\Steve\.dnx\bin;C:\Dev\gradle-2.4\bin;C:\Users\Steve\AppData\Roaming\npm;C:\Users\Steve\AppData\Local\Code\bin;C:\Program Files\Boot2Docker for Windows]
Cloud SDK on PATH: [True]
Installation Properties: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk\properties]
User Config Directory: [C:\Users\Steve\AppData\Roaming\gcloud]
User Properties: [C:\Users\Steve\AppData\Roaming\gcloud\properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]
Account: [...]
Project: [...]
Current Properties:
[core]
project: [...]
account: [...]
disable_usage_reporting: [False]
Logs Directory: [C:\Users\Steve\AppData\Roaming\gcloud\logs]
Last Log File: [C:\Users\Steve\AppData\Roaming\gcloud\logs\2015.07.06\11.43.23.734000.log]
I can't comment so will post as an answer.
You probably have some environmental variable set up in a way that confuses gcloud. Can you also post the output of set cloudsdk from the command line? That should print all the environmental variables with the prefix "cloudsdk". You can redirect it to a file so it's easier to copy: set cloudsdk > environment_cloudsdk.txt.
Not sure how this can happen. If the CLOUDSDK_ env vars are empty, and gcloud.cmd is correct, gcloud shouldn't touch mysql at all. "c:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd" lists at the top what each env var does. Make sure they are not set. Also when you reinstall Cloud SDK, make sure the directory "c:\Program Files\Google\Cloud SDK\" is properly deleted and that there's nothing in the PATH var about it.

Puppet Unable to run Services in chroot environment

Im building a Ubuntu Live ISO with all Openstack services installed and configured for a single node setup(all services installed on same node).
To build this ISO I'm creating a chroot env. by unwrapping Live Ubuntu ISO.
While doing Openstack installation with puppet, puppet is unable to start services in the chroot env.
Eg:
/etc/init.d/mysql status #gives this O/P
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql status
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the status(8) utility, e.g. status mysql
service mysql status
shows no output.
Any pointers will be appreciated :)
I have found that puppet is indeed awkward in chroot jails because the gathering of facter facts does not work appropriately (or something in that vein).
To the problem at hand, though - you way want to make your service resources use an appropriate provider is Puppet doesn't select the right one, e.g.
service { "mysql": provider => upstart }
or even
Service { provider => upstart } # resource default at global scope
See the list of service providers. Note how Puppet is supposed to select the appropriate one on its own, so this may indeed be a problem with the chroot and how it skews facter's deliberations.

Mercurial on Jenkins, installing and configuring

I have a Mercurial repository (on Bitbucket) with some code (Java) and I want to do CI builds on a cloud-based Jenkins server (at Jelastic, running on CentOS). My problem is that I haven't been able to do a proper installation of Mercurial on the Jenkins server.
The Jenkins build fails with the following message:
ERROR: Failed to clone https://bitbucket_jenkins_user:some_password#bitbucket.org/repo_owner/my_repository because hg could not be found; check that you've properly configured your Mercurial installation
Setup information
It's a private Mercurial repository, hosted at Bitbucket
In Bitbucket I have set up a Service to trigger the Jenkins build, after a Push has happened
I have defined a specific bitbucket jenkins user in my Mercurial repository, it has only read rights and it logs in using simple https authentication
Jenkins runs on a Tomcat 7, hosted in a Jelastic cloud environment, on CentOS 6
The Mercurial plugin was installed through the Jenkins interface, by Manage plugins
The build is configured as being triggered remotely (by the service defined in Bitbucket)
Build results are the same when started manually and when triggered from a push to the repository
When I first did this I was under the impression that installing the Mercurial plugin in Jenkins would be enough, that it would also install the needed Mercurial binaries to be able to connect to the repository and get the code. I have realized that I was wrong and that on the Manage Jenkins / Configure System page I need to specify my Mercurial installation.
Questions
Is it possible to create a Mercurial installation without ssh access and doing a "yum install mercurial"?
In the Jenkins interface, what can I specify when choosing the "Install Automatically" option?
When defining an installer, I have experimented with the "Extract zip/tar.gz" option, but what can I write as the "Download URL for binary archive"?
Jenkins also offers an installer option of "Run command". What kind of commands could that be, maybe a "yum install ..." or "rpm ..."?
Since my server is cloud based, getting ssh access is a paid add-on which I would prefer to avoid. But if that is my only option I will of course do it, thereby getting access to running commands on the server. However, running "yum install mercurial" on Centos seems to only give the 1.4 version of Mercurial. Current version when I write this is 2.6.3, would I need to download the sources and compile it myself or is it possible to get that as a binary for Centos somewhere?
The Mercurial Plugin page has a section on how to use the Auto Installation options to install Mercurial using ArchLinux packages.
"The plugin supports generic tool auto-installation methods for your Mercurial installation, though it does not publish a catalog of Mercurial versions. For users of Linux machines (with Python preinstalled), you can use ArchLinux packages. For example, in /configure under Mercurial installations, add a Mercurial installation with whatever Name you like, Executable = INSTALLATION/bin/hg, Install automatically, Run Command, Label = linux (if desired to limit this to slaves configured with the same label), Command = [ -d usr ] || wget -q -O - http://www.archlinux.org/packages/extra/i686/mercurial/download/ | xzcat | tar xvf - (or …/x86_64/… for 64-bit slaves), Tool Home = usr, and configure a job with this installation tied to a Linux slave."
see https://wiki.jenkins-ci.org/display/JENKINS/Mercurial+Plugin

Stop TeamCity from Auto Checkout when adding a repo

I'm trying to configure TeamCity for use in our continuous integration.
Our project has approximately 35 mercurial repos spread across 4 cities. All in all the code in the repos are approximately 30GB in size.
Our problem is that if we add/remove a repo from the VCS roots of a build configuration, the configuration automatically does a complete clean re-checkout of all repos. This adds an extra 3 hours to our build cycle.
Is there anyway to turn this off?
We have TeamCity versions 7.0 and 7.1
UPDATE:
Additional details for one of the build configurations:
Name: BE - Full Build
Description: none
Build number format: %AssemblyBuildNumber%, next build number: #%AssemblyBuildNumber%
Artifact paths:
none specifed
Build options:
hanging builds detection: ON
status widget: OFF
maximum number of simultaneously running builds: unlimited
Version Control Settings edit »
VCS checkout mode: Automatically on server
Checkout directory: default
Clean all files before build: OFF
VCS labeling: disabled
Attached VCS roots:
< All the repos with no rules and no labels >
Show changes from snapshot dependencies: OFF
Perhaps an agent side checkout + local mirror could help you. Take a look at internal properties section here: http://confluence.jetbrains.net/display/TCD7/Mercurial