Uncategorized

RethinkDB is dead ? Long live RebirthDB

Hi,

RethinkDB company has closed the doors, some time ago.
For me as a RethinkDB early developer and advocate, I really worried for the worse.

However when RethinkDB Joined The Linux Foundation, all of us got a little bit of a relief.  This happened on Feb. 6, 2017.

rethinkdb-open

From that point on, things did not change much. I felt a vacuum and only few developers managed to stay by committing with their own resources.

The last release published by the team was 2.3.6 Fantasia (Jul 23,2017).

 

For quite some time, members of the RethinkDB have been waiting for a new release, for project updates, for the founders to show-up for the community.

A freshly new release(2.4) is frozen for almost a year, all seems ready to launch, but nothing happened.

The community tried for several times to contact the founders, but no-one replied.

Without success, for long time we waited. But at some point, people started questioning the complete stone-walling silence from the former founders, and we asked ourselves the question: “Do they actually care?”, “Do they moved to a underground bunker without internet access?”.
It still a misery for many, because the last time we checked, Stripe is not a Coal mine in Zambia, in fact, we strongly believe that they have internet access over there.

The fact of the matter is: I still believe on the technology, I believe and I have built strong and resilient software using it. Software that I’m not keen to re-write. Software that I’m keen to update and monetize strongly for many years to come. People have built entire companies on top of this Database. We can’t just let it die.

We all know the fact: A year and a half has passed since the startup failed. We all know that we can’t see any database in the market fitting the same niche of RethinkDB.
The communication is just not happening, the official website is not updated, there is a slack channel advertised as “official” BUT new users can’t join.

The community is left scattered between Slack, Discord, IRC, Gitter and Google Groups. Too many choices, but not a single word from the founders.

So we decided enough is enough. Its time for us to get together, grab a bunch of volunteers, fork the database, and create a new organization. Start fresh, with a new plan and release the 2.4 ASAP.

Screenshot_20180525_124019

Thanks to @thelinuxlinch for paying from his own funds, the community have funds to start working and develop the Data Compression features we want so much.

Thanks for @Sam, @Atri and many other great devs that did not let us in the dark. We hope to be able to collect funds to sponsor the core work. We understand its very difficult to find developers with the skills we need and we really appreciate the fact that you have not turned the back on us!

If you are interested, please join us: RebirthDB, to help build the next-gen database.

 

Join us also on the RebirthDB @Github and star the project.

Advertisements
Blockchain, Ethererum, Solidity, Uncategorized

Solidity, The Ethereum programming model latest design flaw leads to vulnerability batchOverflow on uint256

Ethereum has a fairly “hard to understand” programming model.

This has been explained in detail on a previous post  Solidity, The Ethereum programming model. 

I highly recommend you read it before to understand some of the biggest flaws on writing Ethereum Smart contracts and prevent bugs.

 

Today I happen to learn a new issue reported by Coinmonks. They seem to have a automated software that scans all ERC20 tokens and reports alerts when very high transactions are performed.

The issue is really interesting, but is not a new issue. In fact its a 2yo issue that remains open on github Arithmetic overflows return silently:

Well, it turns out that someone exploited some poorly written ERC20 smart contract, and for me, its really interesting how people that do not understand the language can produce bizarre bugs.
In this case a bug that can cause millions of dollars to be stolen from its owner.
The issue is very simple, in fact is a issue that most experient programmers would have spotted right away, if they knew the language and what they where doing.

The image bellow shows the vulnerable function: batchTransfer()

Lets try to understand what is going on….shall we ??
In Ethereum Solidity, if you overflow a number it overflows silently and reset its value to 0.
So the attacker explored the issue by sending a batch transfer with a very big number: EG: (0x8000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000)
By having two _receivers passed into batchTransfer(),  with that extremely large _value, the attacker manages to explore the flaw and turn it into profit.
This is a example of how the function would have been called:
 batchTransfer([0x123f681646d4a755815f9cb19e1acc8565a0c2ac,0x123f681646d4a755815f9cb19e1acc8565a0c2ad], 0x8000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000)
This very large number will cause the uint256 number to overflow, and because number overflows in Ethereum silently reset to zero, there is no error, no exception, no nothing and the program silently continues.
With amount zeroed, the hacker manages to pass the sanity checks in lines 258–259 and make the subtraction in line 261 irrelevant.
Finally, because he send two addresses on the function call, the lines 262–265, the owner of the smart contract, unadvised, will be sending the extremely large _value to the hackers, and the hackers on their turn won’t have to spend a dime, due to the overflow issue!
I did a little research to find out if there are more examples like this one, and guess what…
Ethereum Solidity have some issues that they need to give a little more attention to, in fact this one just happen to become a huge problem and could have been avoided at the first place if the Github issue was properly fixed in a timely fashion manner.
I think the Crypto market need to evolve and become a little more professional and start dealing with the problems like Professionals.
There is a problem, no matter who did it, it need to be fixed. And right now, I think we can all agree that overflow a number silently, is kind of critical.

Just to wrap this up, I don’t want to spoil anyone party here. I just think there is a lot going on on Ethereum right now, developers are working hard and is likely that this get fixed soon (HOPEFULLY).

However, one should consider this points, before diving into programming in Solidity, therefore avoid creating new bugs like this.

 

More on the same subject:
Uncategorized

Yarn package manager, a bless or a curse ?

The other day, a developer on my team decided it was a good idea to leave a pull request half done before going on holiday. So, I went to pick this ticket from the board in order to clear-out things and start shipping the product out of the window … It was somewhat quite hard to understand and solve … so I  decided to write here what happened, maybe someone could benefit from it …

So, there was me, all alone with that issue what was “potentially” a quick fix ….

First things first, lets check that the build is green and CI automation is happy …. I Went to Codeship and oh my dear, someone else outside of my team (probably the maintainer of the module) decided it was a good idea to just delete a existing package from the yarn registry (who cares right?). Consequently, the build is now failing and the error is quite bizarre.

error An unexpected error occurred: "https://registry.yarnpkg.com/acorn/-/acorn-4.0.12.tgz: Request failed \"404 Not Found\"".

Screenshot from Codeship:

 

Without being able to believe myself / understand the error, I wondered “Someone is definitely doing something nasty” … So I retried the build 3 times … all ending up with the same error.

So I went to double check that module Yarn is complaining about, with curl I checked for the package URL (To find out the obvious, it was deleted):

 

Yes, it have been deleted. Somehow yarn can’t figure out a solution for it. The author of the pull request said:

 

With no time to loose, I went deeper into the pull request … for minutes I was fighting with Yarn, NPM … all resulting in the same dead end, that dependency somehow always get written inside the yarn lock file, causing the build to fail.

Ok, so lets delete the yarn file and the new one should be good right ? no more issues like that, right ?

No, this time, after deleting the yarn lock file and generating a new one, I’m having some weird tests that where working before, to fail with even more strange error:

 TypeError: this.context.getStore is not a function

I wonder with myself, what next ? should I fight to fix this error, or should I stick with the old one ?? Fight with Yarn or with the new downloaded yarn dependencies that broke this poor project apart ?

I looked at the clock, the day is about to end, and I have to get this out of the window, and fast. So I decided it was about time to get this done, and fast.

I went on Yarn lock file and analyzed it “line by line”, its was about 8.000 lines …  so I finally  I found the culprit:

acorn@^4.0.3, acorn@^4.0.4:
 version "4.0.12"
 resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.12.tgz#335679ab819ec3c78772fe0c2c2f4bfa4359854e"

 

So I went on the web and tried to reach out the github repo for acorn … there is no such version 4.0.12, only 4.0.11 or 4.0.10:

 

So I was like, OMG how the hell this  happened (??), I’m looking at the right acorn ? What to do ? I decided to try my luck with version 4.0.13 ? and TADA, that works like a charm:

acorn@^4.0.3, acorn@^4.0.4:
 version "4.0.13"
 resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"

 

After so many years doing this, I remember, with NPM it (Or … in the old times Maven) it was nothing different … so I was wondering, is Yarn package manager, a bless or a curse ? Is solving something for real or the issue is just now a little less worse ??

You tell me.

 

 

Happy opensource coding to everyone! 😀

Blockchain, Ethererum, Solidity

Solidity, The Ethereum programming model.

Ethereum has a fairly “hard to understand” programming model.

It makes Senior devs, to spend hours chasing their own tails. Wondering what is going on with their code.

 

So I decided to write this little post, in order to clarify some aspects that I think are Crucial on Any programming language.

The main idea is: YES, Solidity can improve, but there are so many things do be done, most of them are basics that any other programming language have. Things that have been solved long time ago.

Would Ethereum survive and thrive ? 

TYPES:

Solidity includes the following types:

hash: 256-bit, 32-byte data chunk, index-able into bytes and operable with bit-wise operations.
uint: 256-bit unsigned integer, operable with bit-wise and unsigned arithmetic operations.
int: 256-bit signed integer, operable with bit-wise and signed arithmetic operations.

real: 256-bit signed fixed-point quantity, 127-bit left of the point, 128-bit right.
string32: zero-terminated ASCII string of maximum length 32-bytes (256-bit).

bytes32: sequence of 32 bytes (256 bit in total).

address: account identifier, similar to a 160-bit hash type.
bool: two-state value.

 

BYTES:

All the types (Hash,uint,int,string32, etc) in Solidity are 256-bit wide.

So, no matter what use use (int8, int16, int32). If you create a type in Solidity, its ALWAYS 256-bit.

The native 256-bit wide primitive type is the bytes32.

Strings

String concatenation must be done by hand after casting to a byte array.

If you want to use indexOf() you must writte your OWN implementation by hand or copy one into your program.

 

String Length

To get the length of a string you must cast it to a byte array.

And it gets worse, If you “accidentally” pass a empty string to a function (normal day to day programming issue). This will cause all arguments after that string to be silently corrupted, and of course make you hate your life and all your relatives mother for couple of days. 😀

 

Numbers

Despite Ethereum being intended to be used by Finance contracts, floating point is not supported AND Integer operations can overflow.

(That’s a feature, not a bug. Said a solidity developer).

There is a enhancement open in order to provide simple basic functions for fixed point types:

 

Arithmetic overflows return silently:

FOR LOOP:

A normal JS programmer, would write a for loop like this:

var a[] = (... think there are +256 elements on this array)
for (var i = 0; i < a.length; i ++) {
 a[i] = i;
}

WELL, if you are programming in Solodity, be advised: This loop it will enter an infinite loop.

Because a[] is a array bigger than 255 elements it will wrap around back to zero.

Arrays:

Array syntax kind of looks like C or Java. BUT, you will freak out now: Array declaration syntax is written backwards:

 int8[][5]

This syntax declares a 5 dynamic arrays of bytes.

 

Array of String

Arrays of Strings is not allowed. You cannot create multi-dimensional dynamic arrays.
Because “string” is a byte array, that means “string[]” does not work. 😀

 

Crash with too large arrays 

A simple uint definition, can cause the compiler to crash with error: Integer constant too large

contract c {
	uint[8**90] ids;
}
contract c {
	struct Data { uint x; uint y; }
	Data[8**90] data;
}

Detailed error:

solidity/libsolidity/ast/Types.cpp(977): Throw in function virtual u256 dev::solidity::RationalNumberType::literalValue(const dev::solidity::Literal *) const
Dynamic exception type: boost::exception_detail::clone_impl<dev::solidity::InternalCompilerError>
std::exception::what: Integer constant too large.
[dev::tag_comment*] = Integer constant too large.

 

JSON:

The documentation includes a list of …. bugs ….

`In some situations, the optimizer replaces certain numbers in the code with routines that compute different numbers`

`Dynamic allocation of an empty memory array caused an infinite loop and thus an exception`

 

Garbage Collection (GC):

Oh, if you use Java, NodeJS or Golang, you are adapted and just love your GC skills. You probably never worry about it.
Solidity have no garbage collection.
Dead allocations are never reclaimed, despite the scarcity of available memory space.
There is also no manual memory management. (SCARED).

 

 

THIS keyword:

In Solidity there is a “this” keyword …

However there are actually security-critical differences between “this.setX()” and “setX()” that can cause wrong results.

I also really love the way they deal with the issue, very fast and precisely providing a correction. This Dev seems to be also very happy about it:

 

Just to wrap this up, I don’t want to spoil anyone party here. I just think there is a loot going on on Ethereum right now, developers are working hard and is likely that this get fixed soon (HOPEFULLY).

However, one should consider this points, before diving into programming in Solidity, therefore avoiding new bugs like the $31M stolen couple months ago.

 

More about it:

Solidity is so riddled with bizarre design errors that it makes PHP4 look like a work of genius.

Exactly, this is a language that they want to run a new economy, not just payment processing, but banking, title transfer, legal resolutions

Underhanded Solidity Coding Contest 

Deconstructing the DAO Attack: A Brief Code Tour

List of “closed” bugs on Ethereum Solidity

List of Open bugs on Ethereum Solidity

Uncategorized

Kubernetes DevOps day-to-day tasks and commands – Kubernetes/HELM Cheatsheet

 

Often I see members of my team struggling to remember the somehow hard to remember commands for operating Kubernetes. Its quite hard to find a descent documentation that goes straight to the point. Not much lalala, but just give me the CMD I’m looking for.

This is a curated list that I’ve been updating periodically with many of the commands I use day to day on operations, so if you know anything that is not here, please let me know! 😀

Kubernetes DevOps day-to-day tasks and commands

devops

 

Kubernetes – How to change the scope to another namespace

$ kubectl config set-context $(kubectl config current-context) --namespace=env-JIRA-1234

Kubernetes – How to List the active pods on a namespace:

$ kubectl get pods
NAME READY STATUS RESTARTS AGE
golang-api-1280745034-4s6jt 1/1 Running 0 17m
golang-api-1280745034-7knzq 1/1 Running 0 17m
``

 

Kubernetes – How to Get the logs for a POD:

$ kubectl logs golang-api-1280745034-4s6jt

 

Kubernetes – How to Get services the Load Balancer IP addresses for a Namespace:

$ kubectl get services --namespace=develop
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
(...)

 

Kubernetes – How to Get the ingres and services for a Namespace:

$ kubectl get ing,service --namespace=develop

Kubernetes – How to Get info about the services for a Namespace

$ kubectl describe services --namespace=develop 
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
(...)

Kubernetes – How to Get info about the services for ALL Namespaces

$ kubectl get services --all-namespaces
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
(...)

 

Kubernetes – How to open a proxy to a POD and expose it locally OR (How to connect to a POD directly and expose it locally)

$ kubectl port-forward golang-api-1280745034-4s6jt 8888:3000

 

Kubernetes – How to configure kubectl to always point to same cluster

$ kubectl config set-context gke_apps_europe-west1-b_europa --namespace=prod

Kubernetes – How to Get the current context (The cluster kubectl is pointing to)

$ kubectl config current-context

Kubernetes – How to setup kubectl Auto Complete

$ source <(kubectl completion bash)

Kubernetes – How to check resource utilization (TOP) for all nodes (Cluster legs)

$kubectl top nodes

Kubernetes – How to check resource utilization (TOP) for all pods in all namespaces

$ kubectl top pods --all-namespaces

Kubernetes – How to WATCH constantly the resource utilization for all pods in a particular namespace and order the results so they don’t keep changing all the time.

$ watch "kubectl top pods --namespace=prod |sort"

Kubernetes – How to WATCH constantly the resource utilization for nodes in a particular namesmace (legs) and order the results so they don’t keep changing all the time.

$ watch "kubectl top nodes --namespace=prod |sort"

Kubernetes – How to WATCH constantly the resource utilization for all pods in ALL namespaces and order the results so they don’t keep changing all the time.

$ watch "kubectl top pods --all-namespaces |sort"

 

Kubernetes – How to kill all running jobs:

`kubectl delete jobs -l `

Kubernetes – How to SSH inside a node to execute commands

 gcloud compute ssh gke-cluster-default-pool-123-4321s --zone europe-west1-c

 

Kubernetes – How to SSH inside the pod and perform a curl on the healthcheck endpoint. This is particular useful for troubleshot and assert that the service is really running and healthy.

$ kubectl exec -ti golang-api-1280745034-4s6jt curl http://localhost:3000/health`

 

Kubernetes – How to Change the configuration file  ‘on the fly’

 kubectl apply -f kubernetes/config/develop.yaml

Kubernetes – How to Restart all PODS in one go:

 $kubectl delete pods -l app=golang-api --namespace=prod

Kubernetes – How to List all Environment variables for a particular POD

$ kubectl exec -ti golang-api-4135068084-3wpb5 env --namespace=prod

Kubernetes – How to Check health for a particular backend POD from inside the frontend pod in order to test that they connect with no issues

$ kubectl exec -ti front-end-355436834-whtnp curl http://golang-api/health --namespace=prod

Kubernetes – How to Check for all logs inside the main scheduler

 $ journalctl -f

Kubernetes – How to List all pods and order them by how many times they have restarted. This is useful to detect memory leaks or debug the pods that are restarting more often.

$ kubectl get pods --sort-by=.status.containerStatuses[0].restartCount

Kubernetes – How to test that your API is returning something on a particular endpoint directly inside the POD (Useful when you deploy something but is not working .. you are pulling your hair out and hating kubernetes … keep call and curl it from inside 😀 )

$ kubectl exec -ti frontend-355436834-whtnp curl http://golang-api/find/1 --namespace=develop

 

Kubernetes – How to proxy a existing InfluxDB pod so you can use it locally:

$ kubectl port-forward --namespace monitoring $(kubectl get pods --namespace monitoring -l app=influxdb-influxdb -o jsonpath='{ .items[0].metadata.name }') 8086:8086

 

GCLOUD: How to list all images for your Docker eu.gcr.io:

gcloud

$ gcloud container images list-tags eu.gcr.io/thomasmodeneis-apps/golang-api

 

HELM DevOps day-to-day tasks and commands

helm

HELM – How to deploy a Docker image from eu.gcr.io to your cluster:

$ export NAMESPACE=develop
$ export VERSION=1.0.0
$ helm upgrade -i golang-api-$NAMESPACE ./helm_chart \ 
--namespace=$NAMESPACE 
--values helm_values/develop.yaml 
--set cluster=clustername,version=$VERSION

 

HELM – How to delete a chart and all its pods

helm delete redis-develop

 

HELM – How to delete a chart and all its pods for a specific namespace:

helm delete redis-develop --namespace=cache-develop

 

HELM – How to delete a chart and all its pods and purge it, in order to also delete PV and PVC’s associated to it: (Caution, this will delete all your data from stored disks).

helm delete redis-develop --purge

 

 

I hope it helps,

 

Happy opensource coding for everyone 😀

docker, gcloud, golang, kubectl, kubernetes-dedicated, linux, ubuntu

Installing Kubectl with GCloud – Common errors

The Google recommended steps for installing the GCloud and Kubectl are somehow confusing, and I see that often, members of my team are confused and can’t find good enough instructions in order to have this installed correctly.

ERROR 1:  Google is not able to enable component manager. If you have found this post on google search, chances are that you are stuck with the error.

ERROR: (gcloud.components.update) The component manager is disabled for this installation

ERROR 2: Google cant find default credentials

error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

ERROR 3: Kubectl can’t do anything … error is confusing (what now ?)

➜ kubectl get pods --namespace=develop
 The connection to the server localhost:8080 was refused - did you specify the right host or port?

 

docker_kubernetes

If you have followed the installation instructions for Mac, Ubuntu,  (and others) Linux distributions chances are that you end-up with a incomplete  google cloud SDK installation.

kubectl is missing on the default instalation, together few many other important tooling.

 

We will start by listing and learning some useful cheat-sheet commands:

List all availbale components:
$ gcloud components list

Your current Cloud SDK version is: 154.0.1
The latest available version is: 154.0.1

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Components │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬───────────┤
│ Status │ Name │ ID │ Size │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼───────────┤
│ Not Installed │ App Engine Go Extensions │ app-engine-go │ 47.9 MiB │
│ Not Installed │ Bigtable Command Line Tool │ cbt │ 3.9 MiB │
│ Not Installed │ Cloud Datalab Command Line Tool │ datalab │ < 1 MiB │
│ Not Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 15.4 MiB │
│ Not Installed │ Cloud Datastore Emulator (Legacy) │ gcd-emulator │ 38.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 21.0 MiB │
│ Not Installed │ Emulator Reverse Proxy │ emulator-reverse-proxy │ 14.5 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ 3.4 MiB │
│ Not Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB │
│ Not Installed │ gcloud Beta Commands │ beta │ < 1 MiB │
│ Not Installed │ gcloud app Java Extensions │ app-engine-java │ 128.6 MiB │
│ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 6.1 MiB │
│ Not Installed │ kubectl │ kubectl │ 14.9 MiB │
│ Installed │ BigQuery Command Line Tool │ bq │ < 1 MiB │
│ Installed │ Cloud SDK Core Libraries │ core │ 6.0 MiB │
│ Installed │ Cloud Storage Command Line Tool │ gsutil │ 2.9 MiB │
│ Installed │ Default set of gcloud commands │ gcloud │ │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴───────────┘


To install or remove components at your current SDK version [154.0.1], run:
 $ gcloud components install COMPONENT_ID
 $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [154.0.1], run:
 $ gcloud components update

 

How to resolve ERROR 1: (gcloud.components.update) The component manager is disabled for this installation:

If you try to use the recommended way to install anything, it will fail and argue something with very little sense like …

ERROR: (gcloud.components.update) The component manager is disabled for this installation

 

 

Solution: Remove the google recommended way of installing the Google Cloud SDK and install it again, this time doing it the right way:

 

  • UBUNTU install steps:
sudo apt-get update
sudo apt-get remove google-cloud-sdk
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
gcloud components list

Optionally you can run the one liner command :

sudo apt-get remove google-cloud-sdk && curl -sSL https://sdk.cloud.google.com | bash -

 

After installing and initializing the gcloud, you are finally able to install a full-blown Cloud SDK installation:

$ gcloud components install kubectl

Your current Cloud SDK version is: 154.0.1
Installing components from version: 154.0.1

┌──────────────────────────────────────────────┐
│ These components will be installed. │
├─────────────────────────┬─────────┬──────────┤
│ Name │ Version │ Size │
├─────────────────────────┼─────────┼──────────┤
│ kubectl │ │ │
│ kubectl (Linux, x86_64) │ 1.6.2 │ 14.9 MiB │
└─────────────────────────┴─────────┴──────────┘

For the latest full release notes, please visit:
 https://cloud.google.com/sdk/release_notes

Do you want to continue (Y/n)? y

╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl (Linux, x86_64) ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝

Performing post processing steps...done. 

Update done

 

After this, you should be able to use gcloud with kubectl. However, you will have to solve more errors … keep reading.

 

GCLOUD Kubectl Common errors:

Problems may raise. One of them is not having the gcloud configs properly set. This will get you an error like this:

How to resolve ERROR 2: GCLOUD is not able to get your credentials, kubectl is blocked:

error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

This can be fixed by setting the container credentials for the cluster you are wanting to target:

gcloud container clusters get-credentials europa

 

How to resolve ERROR 3: kubectl complains can’t find localhost:8080 (???)  

➜ kubectl get pods --namespace=develop
 The connection to the server localhost:8080 was refused - did you specify the right host or port?

To get this solved, you will have to run the gcloud container clusters get-credentials:

gcloud container clusters get-credentials yourclustername
 Fetching cluster endpoint and auth data.
 kubeconfig entry generated for yourclustername.

 

As you can see, there are many things that can go wrong. But we luck you have most of it covered here. Please let me know if you happen to find any other error that is not covered here.

I hope it helps.

Cheers.

linux, ubuntu

How to fix: ERROR: ld.so: object ‘libgtk3-nocsd.so.0’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

This days, after doing a update on Ubuntu, I stumbled upon this error:

ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. 

I’ve looked for answers on the web but there is nothing really specific about it…

I found there is a bug opened on Date: Tue, 10 May 2016 11:27:02 UTC: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823914

But there is no clear resoliton.

It seems that they have raised a bug for the lib, but I’m not sure how this fixed the issue. There is no comments: https://sourceware.org/bugzilla/show_bug.cgi?id=20172

 

The problem seems to be that Ubuntu is looking for a library that does not exist for some reason.

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0

 

So if you check for the file, you won’t find anything:

ls -l /usr/lib/x86_64-linux-gnu/ |grep libgtk3

Fortunately, after a big of dig here and there, I’ve found that there is a quick fix. Execute the following command and install the missing library: gtk3-nocsd

$ sudo apt-get install gtk3-nocsd

----- OUTPUT ------
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following package was automatically installed and is no longer required:
 libgcrypt20:i386
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
 libgtk3-nocsd0
The following NEW packages will be installed:
 gtk3-nocsd libgtk3-nocsd0
0 upgraded, 2 newly installed, 0 to remove and 119 not upgraded.
Need to get 53,0 kB of archives.
After this operation, 125 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://nl.archive.ubuntu.com/ubuntu artful/universe amd64 libgtk3-nocsd0 amd64 3-1 [13,5 kB]
Get:2 http://nl.archive.ubuntu.com/ubuntu artful/universe amd64 gtk3-nocsd all 3-1 [39,5 kB]
Fetched 53,0 kB in 2min 0s (440 B/s)
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
Selecting previously unselected package libgtk3-nocsd0:amd64.
(Reading database ... 423877 files and directories currently installed.)
Preparing to unpack .../libgtk3-nocsd0_3-1_amd64.deb ...
Unpacking libgtk3-nocsd0:amd64 (3-1) ...
Selecting previously unselected package gtk3-nocsd.
Preparing to unpack .../gtk3-nocsd_3-1_all.deb ...
Unpacking gtk3-nocsd (3-1) ...
Setting up libgtk3-nocsd0:amd64 (3-1) ...
Setting up gtk3-nocsd (3-1) ...
Processing triggers for libc-bin (2.24-12ubuntu1) ...
Processing triggers for man-db (2.7.6.1-2) ...

 

Check that you have the required file:

ls -l /usr/lib/x86_64-linux-gnu/ |grep libgtk3
-rwSr--r-- 1 root root 26616 jun 1 2016 libgtk3-nocsd.so.0

 

Happy opensource coding for everyone! 😀