jenkinsci / azure-storage-plugin

21 stars 45 forks source link

Cannot connect to Azure Storage #114

Closed mathiasi closed 6 years ago

mathiasi commented 6 years ago

I'm trying this plugin for the first time but I'm having some difficulties getting it to connect to Azure Storage. Ultimately I want to upload artifacts to Azure File Storage. I have created a temporary storage resource for testing. I can connect to it using the Azure Storage Explorer and CloudBerry Explorer however no matter what settings I use, I cannot get the plugin to connect. I've tried different blob endpoints but without luck. From what I've gathered it should be left as default or blank for my purposes. Please see the attached screenshot. Can someone spot anything wrong or is there a way for me to debug the connection issue?

image

juniwang commented 6 years ago

@mathiasi if you the leave blob endpoint url as blank, a default http://blob.core.windows.net/ will be used. Please check your Storage Account's configuration that Secure transfer required. If it's enabled the default endpoint many not work. You can manually input the endpoint with https if that's the case.

Besides, is there any logs in Jenkins logs? we are expected some error messages to be recorded in case of validation failure.

mathiasi commented 6 years ago

@juniwang "Secure transfer required" is disabled. I have tried to following endpoints: blank http(s)://blob.core.windows.net/ http(s)://core.windows.net/ http(s)://jenkinsuploadtest.blob.core.windows.net/

I went to /log/all however I cannot see any logs regarding failed validation. I tried to execute a job anyway and it returned:

Step ‘Upload artifacts to Microsoft Azure Storage’ aborted due to exception: 
java.io.IOException: Plugin can not continue, until previous errors are addressed
    at com.microsoftopentechnologies.windowsazurestorage.WAStoragePublisher.perform(WAStoragePublisher.java:408)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1749)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:421)

Not sure if it is useful.

juniwang commented 6 years ago

I think the logs is not enough to find the root cause . There are lots of reasons may lead to the exception above, incorrect storage account configuration is one of them.

I tried both locally and new Jenkins instance on Azure but cannot reproduce it. @ArieShout do you have any ideas

allxiao commented 6 years ago

I could not reproduce the issue either.

A common mistake made during the configuration is when copy/paste, some extra invisible characters (e.g., a space or a line feed) are pasted into the Storage Account Name or Storage Account Key box, which may lead to the validation failure.

My suggestion is copy/paste the name and key to text editor (e.g., notepad) first, and then copy only the text part to the input box.

gavinfish commented 6 years ago

Hi @mathiasi , has your problem been solved?

mathiasi commented 6 years ago

@gavinfish - I eventually gave up and foundan alternative way of achieving my goal. I cannot verify whether it is still a problem for me but seeing that other people were not able to reproduce I'm going to close the issue.