Skip to content

openshift mysql image won't start #1740

Closed

Description

@thoraxe
/usr/local/bin/run-mysqld.sh: line 4: /var/lib/mysql/.bashrc: Permission denied
/usr/local/bin/run-mysqld.sh: line 115: /var/lib/mysql/my.cnf.template: Permission denied

Created from the following JSON:

{
  "apiVersion": "v1beta1",
  "items": [
    {
      "apiVersion": "v1beta1",
      "containerPort": 3306,
      "id": "database",
      "kind": "Service",
      "port": 5434,
      "selector": {
        "name": "database"
      }
    },
    {
      "apiVersion": "v1beta1",
      "kind": "DeploymentConfig",
      "metadata": {
        "name": "database"
      },
      "template": {
        "controllerTemplate": {
          "podTemplate": {
            "desiredState": {
              "manifest": {
        "volumes": [
          {
            "name": "var-lib-mysql",
              "source": {
            "hostDir": null,
            "emptyDir": {},
            "persistentDisk": null,
            "gitRepo": null
              }
           }
        ],
                "containers": [
                  {
                    "env": [
                      {
                        "name": "MYSQL_ROOT_PASSWORD",
                        "value": "${MYSQL_ROOT_PASSWORD}"
                      },
                      {
                        "name": "MYSQL_DATABASE",
                        "value": "${MYSQL_DATABASE}"
                      }
                    ],
                    "image": "openshift/mysql-55-centos7",
                    "name": "ruby-helloworld-database",
                    "ports": [
                      {
                        "containerPort": 3306
                      }
                    ],
            "volumeMounts": [
              {
            "name": "var-lib-mysql",
            "mountPath": "/var/lib/mysql",
            "path": "/var/lib/mysql"
              }
            ]
                  }
                ],
                "version": "v1beta1"
              }
            },
            "labels": {
              "name": "database"
            }
          },
          "replicaSelector": {
            "name": "database"
          },
          "replicas": 1
        },
        "strategy": {
          "type": "Recreate"
        }
      },
      "triggers": [
        {
          "type": "ConfigChange"
        }
      ]
    }
  ],
  "kind": "Template",
  "metadata": {
    "annotations": {
      "description": "This example shows how to create a simple ruby application in openshift origin v3"
    },
    "name": "ruby-helloworld-sample"
  },
  "parameters": [
    {
      "description": "administrator username",
      "from": "admin[A-Z0-9]{3}",
      "generate": "expression",
      "name": "ADMIN_USERNAME"
    },
    {
      "description": "administrator password",
      "from": "[a-zA-Z0-9]{8}",
      "generate": "expression",
      "name": "ADMIN_PASSWORD"
    },
    {
      "description": "database password",
      "from": "[a-zA-Z0-9]{8}",
      "generate": "expression",
      "name": "MYSQL_ROOT_PASSWORD"
    },
    {
      "description": "database name",
      "name": "MYSQL_DATABASE",
      "value": "root"
    }
  ],
  "labels": {
    "template": "application-template-stibuild"
  }
}
osc v0.4.3.2
kubernetes v0.14.1-582-gb12d75d

Activity

  1. added
    kind/bug
    on Apr 14, 2015
  2. added this to the 0.5.0 (beta3) milestone on Apr 14, 2015
  3. xjvs commented on Apr 15, 2015

    @xjvs

    There is another similar issue I reported before #1589

  4. mfojtik commented on Apr 15, 2015

    @mfojtik
    Contributor

    @smarterclayton this should be assigned to @mnagy as mysql owner

  5. mnagy commented on Apr 15, 2015

    @mnagy
    Contributor

    @thoraxe You need to use /var/lib/mysql/data for the volume, not /var/lib/mysql.

    @xjvs this seems unrelated to #1589.

  6. sdodson commented on Apr 16, 2015

    @sdodson
    Member

    So, I've worked with this example from the training quite a bit tonight. The things I've found are that the template lacks required parameters, namely MYSQL_USER and MYSQL_PASSWORD this is a difference between mysql and openshift/mysql-55-centos7. Beyond that I got the same permissions errors that Erik got but I think it's because the volume is misconfigured and it's re-using a volume from a previous run, when i removed the volume from the pod definition everything worked.

    I'll read more about volume configuration tomorrow, but I'm not certain this is any sort of bug, just misconfigured database pod definition. We should probably remove all volume definitions from the training materials, that was really only put in place to work around selinux bugs in docker 1.4 which we no longer have to worry about.

    For reference the steps we're following are https://github.com/openshift/training/blob/beta3/beta-3-setup.md#create-the-database-config

  7. sdodson commented on Apr 21, 2015

    @sdodson
    Member

    I believe this can be closed, the problems were in the training templates for the pod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions