{"action":"created","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/5631","repository_url":"https://api.github.com/repos/gocd/gocd","labels_url":"https://api.github.com/repos/gocd/gocd/issues/5631/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/5631/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/5631/events","html_url":"https://github.com/gocd/gocd/issues/5631","id":394347250,"node_id":"MDU6SXNzdWUzOTQzNDcyNTA=","number":5631,"title":"Unable to start GoCD server in Azure Container Instance because of config.git file lock","user":{"login":"rohitramu","id":8553814,"node_id":"MDQ6VXNlcjg1NTM4MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8553814?v=4","gravatar_id":"","url":"https://api.github.com/users/rohitramu","html_url":"https://github.com/rohitramu","followers_url":"https://api.github.com/users/rohitramu/followers","following_url":"https://api.github.com/users/rohitramu/following{/other_user}","gists_url":"https://api.github.com/users/rohitramu/gists{/gist_id}","starred_url":"https://api.github.com/users/rohitramu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohitramu/subscriptions","organizations_url":"https://api.github.com/users/rohitramu/orgs","repos_url":"https://api.github.com/users/rohitramu/repos","events_url":"https://api.github.com/users/rohitramu/events{/privacy}","received_events_url":"https://api.github.com/users/rohitramu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-27T09:45:57Z","updated_at":"2019-01-04T08:32:55Z","closed_at":null,"author_association":"NONE","body":"##### Issue Type\r\nBug Report\r\n\r\n##### Summary\r\n**Full log file is here: [go-server.log](https://github.com/gocd/gocd/files/2712025/go-server.log)**\r\n\r\nI'm attempting to create an Azure Container Instance using the `gocd/gocd-server:v18.12.0` Docker image.  When I tested it out for the first time, it was working great.  I then wanted to adjust the setup so I wouldn't lose all the data if the container went down - I tried to create the container instance with a mounted Azure file share, but then the GoCD server failed to start up.\r\n\r\nThis is the Azure CLI command I'm using to create the container (I've replaced the environment-specific values with variable names):\r\n```PowerShell\r\naz container create `\r\n    --resource-group $resourceGroupName `\r\n    --name 'gocd-server' `\r\n    --image 'gocd/gocd-server:v18.12.0' `\r\n    --dns-name-label $dnsLabel `\r\n    --ports '8154' `\r\n    --azure-file-volume-account-name $storageAccountName `\r\n    --azure-file-volume-account-key $storageAccountAccessKey `\r\n    --azure-file-volume-share-name $fileShareName `\r\n    --azure-file-volume-mount-path '/godata'\r\n```\r\n\r\nThis same command works with other Docker images (e.g. I'm running JFrog Artifactory in a container with an attached file share, and that seems to work fine).  This is the first error I see in the log, plus the first two lines of the stack trace:\r\n```\r\n2018-12-27 07:34:51,363 ERROR [main] ContextLoader:350 - Context initialization failed\r\njava.lang.RuntimeException: java.nio.file.FileSystemException: /go-working-dir/db/config.git/.git/HEAD.lock.567b8b3585b44cc69d5aa41c9851af10 -> db/config.git/.git/HEAD.lock: Not supported\r\n\tat com.thoughtworks.go.server.initializers.ApplicationInitializer.onApplicationEvent(ApplicationInitializer.java:166)\r\n\tat com.thoughtworks.go.server.initializers.ApplicationInitializer.onApplicationEvent(ApplicationInitializer.java:52)\r\n```\r\nFurther down, I see this error as well:\r\n```\r\n2018-12-27 07:34:51,542 ERROR [main] GoServer:76 - ERROR: Failed to start GoCD server.\r\njava.lang.RuntimeException: java.nio.file.FileSystemException: /go-working-dir/db/config.git/.git/HEAD.lock.567b8b3585b44cc69d5aa41c9851af10 -> db/config.git/.git/HEAD.lock: Not supported\r\n\tat com.thoughtworks.go.server.initializers.ApplicationInitializer.onApplicationEvent(ApplicationInitializer.java:166)\r\n\tat com.thoughtworks.go.server.initializers.ApplicationInitializer.onApplicationEvent(ApplicationInitializer.java:52)\r\n```\r\n\r\n##### Environment\r\n\r\n###### Basic environment details\r\n\r\n* GoCD Docker Image Version: `v18.12.0`\r\n\r\n\r\n###### Additional Environment Details\r\n\r\n<!-- More environment details captured from the support API or other sources can be shared here -->\r\n\r\n##### Steps to Reproduce\r\n\r\n<!--- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!--- reproduce this bug include code to reproduce, if relevant -->\r\n1. In the Azure Portal (https://portal.azure.com), create:\r\n    1. An account (a free trial should work fine)\r\n    2. A Resource Group\r\n    3. A storage account\r\n    4. A file share within that storage account\r\n2. Run the following PowerShell script from CloudShell (click the button on the top bar of the UI that looks like `>_` and select \"PowerShell\" with a new/different file share in the existing storage account). Remember to first replace the variables in the script to point to the resources you just created:\r\n```PowerShell\r\naz container create `\r\n    --resource-group $resourceGroupName `\r\n    --name 'gocd-server' `\r\n    --image 'gocd/gocd-server:v18.12.0' `\r\n    --dns-name-label $dnsLabel `\r\n    --ports '8154' `\r\n    --azure-file-volume-account-name $storageAccountName `\r\n    --azure-file-volume-account-key $storageAccountAccessKey `\r\n    --azure-file-volume-share-name $fileShareName `\r\n    --azure-file-volume-mount-path '/godata'\r\n```\r\nYou can get the `$storageAccountAccessKey` by going to \"Access Keys\" under the \"Settings\" section in your storage account.\r\n`$dnsLabel` can be any string that is unique in the Resource Group's region.\r\n3. Browse to your resource group, then select the newly created container instance.  In a new browser tab, go to the URL specified by the FQDN field, specifying the GoCD server port (e.g. `https://my-dns-label.my-region.azurecontainer.io:8154`).\r\n4. You can get the logs and see the rest of the `/godata` folder by navigating to your storage account and clicking on `Storage Explorer (Preview) ->File Shares -> yourFileShareName`.\r\n"},"comment":{"url":"https://api.github.com/repos/gocd/gocd/issues/comments/451383409","html_url":"https://github.com/gocd/gocd/issues/5631#issuecomment-451383409","issue_url":"https://api.github.com/repos/gocd/gocd/issues/5631","id":451383409,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTM4MzQwOQ==","user":{"login":"prateekbaheti","id":1955832,"node_id":"MDQ6VXNlcjE5NTU4MzI=","avatar_url":"https://avatars3.githubusercontent.com/u/1955832?v=4","gravatar_id":"","url":"https://api.github.com/users/prateekbaheti","html_url":"https://github.com/prateekbaheti","followers_url":"https://api.github.com/users/prateekbaheti/followers","following_url":"https://api.github.com/users/prateekbaheti/following{/other_user}","gists_url":"https://api.github.com/users/prateekbaheti/gists{/gist_id}","starred_url":"https://api.github.com/users/prateekbaheti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prateekbaheti/subscriptions","organizations_url":"https://api.github.com/users/prateekbaheti/orgs","repos_url":"https://api.github.com/users/prateekbaheti/repos","events_url":"https://api.github.com/users/prateekbaheti/events{/privacy}","received_events_url":"https://api.github.com/users/prateekbaheti/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T08:32:55Z","updated_at":"2019-01-04T08:32:55Z","author_association":"NONE","body":"Looks like the cause of the issue is that creation of links (soft and hard) is not supported on the mounted Fileshare. When go server tries to initialize a git repository for config.xml using jgit it tries to create a link and that fails.\r\n\r\nWe would need to set the mfsymlinks option while mounting the volume. Unfortunately there [does not seem to be an option](https://stackoverflow.com/questions/53876128/set-mfsymlinks-when-mounting-azure-file-volume-to-aci-instance) to do this yet."}}
{"actor":{"display_login":"prateekbaheti"}}