paralin / openshift-under-kubernetes

A full system for deploying and managing Openshift Origin under an existing Kubernetes cluster.
Apache License 2.0
16 stars 5 forks source link

Fails with "TypeError: coercing to Unicode: need string or buffer, NoneType found" #3

Closed siamak-haschemi closed 8 years ago

siamak-haschemi commented 8 years ago

Running the tool results in an exception.

$ python --version
Python 2.7.10
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.3 (15D21)
      ...
$ openshift-under-kubernetes deploy --create-volume 
Loading kube config...
[note] we are in insecure mode, disabling warnings
Checking connectivity...
Currently there are 2 namespaces in the cluster.
Everything looks good, proceeding.
()
Collecting some initial cluster info...
list index out of range
It looks like we do not have the openshift-origin namespace, and do not have a working ReplicationController.
Currently I do not consider this a complete OpenShift deployment.
()
Preparing to execute deploy...
Deploy temp dir: /var/folders/d3/3_r1kst90rg7ydfqwlhrq9fh0000gn/T/tmpjRkJ4C
Creating openshift-deploy namespace...
Creating openshift-origin namespace...
Will use load balancer type service.
Creating 'openshift' service...
Waiting for service load balancer IP to be allocated...
External OpenShift IP: 146.148.**.**
Internal OpenShift IP: 10.3.**.**
Creating create-config-script secret...
Creating kubeconfig secret...
Generating openshift config via cluster...
Creating config generation pod...
Waiting for generate-config pod to finish...
Checking logs...
Retreived config bundle successfully.
Traceback (most recent call last):
  File "/usr/local/bin/openshift-under-kubernetes", line 9, in <module>
    load_entry_point('openshift-under-kubernetes==1.2.5', 'console_scripts', 'openshift-under-kubernetes')()
  File "/Library/Python/2.7/site-packages/openshift_under_kubernetes/cli.py", line 561, in main
    cli()
  File "/Library/Python/2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/openshift_under_kubernetes/cli.py", line 186, in deploy
    with open(server_key, 'r') as fs:
TypeError: coercing to Unicode: need string or buffer, NoneType found
siamak-haschemi commented 8 years ago

I assume I am missing the --server-key option.

I use k8s on Google's GKE. Do I have to generate that key, or is it a pre-created key?

paralin commented 8 years ago

This is a Python 2 vs Python 3 error, but it also looks like your file is missing.

You need to SSH into your kube master and grab /srv/kubernetes/serviceaccount.key (off the top of my head, the path might be slightly different) and pass the path to that with --server-key

Create-volume is a extremely alpha feature and will only work on the newest builds of kubernetes. You can manually make a pv and pass the name of it if you want to use an old cluster version.

I'll work on adding better detection for these errors before the script actually makes anything.

On Sat, Mar 26, 2016, 6:24 AM Siamak Haschemi notifications@github.com wrote:

I assume I am missing the --server-key option.

I use k8s on Google's GKE. Do I have to generate that key, or is it a pre-created key?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/paralin/openshift-under-kubernetes/issues/3#issuecomment-201752627