# Azure Blob Storage Plugin

**URL:** https://meta.discourse.org/t/azure-blob-storage-plugin/79392
**Category:** Plugin
**Tags:** broken
**Created:** [January 30, 2018, 9:28pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392 "2018-01-30T21:28:29Z")
**Posts on this page:** 17
**Page:** 5

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [August 15, 2020, 11:52am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/89 "2020-08-15T11:52:56Z")

</div>

I just installed it yesterday. I am still playing around with it but it seems generally functional.

---

<div class="post-metadata">

### Author: ![Ludovik\_Dopierala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ludovik_dopierala/32/193103_2.png) [@Ludovik\_Dopierala](https://meta.discourse.org/u/Ludovik_Dopierala)
#### Post date: [September 9, 2020, 11:08pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/90 "2020-09-09T23:08:59Z")

</div>

Hello

I try to use your plugin… Some feature are OK. For example I can add my website logo and it go my azure blob storage.

But

When I upload picture on post, the image is not show. I have this :

> Citation `![quete-viking-coin-master|362x500](upload://tBpGuefbyQNcVbDgJzOyv32uxFX.jpeg)`

Do you have an idea ? Is your plugin is always working ?

Thanks for anwser

---

<div class="post-metadata">

### Author: ![Karl\_Romanowski](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/karl_romanowski/32/87676_2.png) [@Karl\_Romanowski](https://meta.discourse.org/u/Karl_Romanowski)
#### Post date: [January 14, 2021, 6:34pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/91 "2021-01-14T18:34:10Z")

</div>

I just tried installing this plugin on v2.7.0 beta1 and got this error, which looks similar to the faraday issue above but with nokogiri:

```
I, [2021-01-13T22:25:07.678431 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::ConflictError: Unable to activate azure-storage-common-2.0.1, because nokogiri-1.11.1-x86_64-linux conflicts with nokogiri (~> 1.10.4)
/var/www/discourse/lib/plugin_gem.rb:22:in `load'
/var/www/discourse/lib/plugin/instance.rb:705:in `gem'
/var/www/discourse/plugins/discourse-azure-blob-storage/plugin.rb:12:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:611:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:611:in `activate!'
lib/discourse.rb:228:in `block in activate_plugins!'
lib/discourse.rb:225:in `each'
lib/discourse.rb:225:in `activate_plugins!'
/var/www/discourse/config/application.rb:305:in `block in <class:Application>'
/var/www/discourse/lib/plugin_initialization_guard.rb:5:in `plugin_initialization_guard'
/var/www/discourse/config/application.rb:304:in `<class:Application>'
/var/www/discourse/config/application.rb:71:in `<module:Discourse>'
/var/www/discourse/config/application.rb:70:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'

```

EDIT: Works fine with version: d6121249d3856a40382637ed12db50fc43c1fb1d (2.6.0)

---

<div class="post-metadata">

### Author: ![cgreco](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@cgreco](https://meta.discourse.org/u/cgreco)
#### Post date: [January 20, 2021, 1:27am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/92 "2021-01-20T01:27:13Z")

</div>

also receiving this error after upgrade to v2.7.0beta1. CAn this plugin be updated to run on the newest release?

```plaintext
I, [2021-01-19T19:52:36.859512 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake plugin:pull_compatible_all'
rake aborted!
Gem::ConflictError: Unable to activate azure-storage-common-2.0.1, because nokogiri-1.11.1-x86_64-linux conflicts with nokogiri (~> 1.10.4)
/var/www/discourse/lib/plugin_gem.rb:22:in `load'
/var/www/discourse/lib/plugin/instance.rb:705:in `gem'
/var/www/discourse/plugins/discourse-azure-blob-storage/plugin.rb:12:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:611:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:611:in `activate!'
lib/discourse.rb:228:in `block in activate_plugins!'
lib/discourse.rb:225:in `each'
lib/discourse.rb:225:in `activate_plugins!'
/var/www/discourse/config/application.rb:305:in `block in <class:Application>'
/var/www/discourse/lib/plugin_initialization_guard.rb:5:in `plugin_initialization_guard'
/var/www/discourse/config/application.rb:304:in `<class:Application>'
/var/www/discourse/config/application.rb:71:in `<module:Discourse>'
/var/www/discourse/config/application.rb:70:in `<top (required)>'
/var/www/discourse/Rakefile:7:in `require'
/var/www/discourse/Rakefile:7:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 20, 2021, 2:14am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/93 "2021-01-20T02:14:56Z")

</div>

> [@cgreco](#):
>
> CAn this plugin be updated to run on the newest release?

It is categorized on the #plugin:broken-plugin category, so it’s not working at the moment, and there appear to be no one interested in get it back in shape.

---

<div class="post-metadata">

### Author: ![andrueastman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrueastman/32/206916_2.png) [@andrueastman](https://meta.discourse.org/u/andrueastman)
#### Post date: [January 22, 2021, 10:30am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/94 "2021-01-22T10:30:41Z")

</div>

> [@Falco](#):
>
> It is categorized on the #plugin:broken-plugin category, so it’s not working at the moment, and there appear to be no one interested in get it back in shape.

That is a sad story. ☹

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [February 20, 2021, 3:17pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/95 "2021-02-20T15:17:58Z")

</div>

Only got this error when I tried to rebuild today.

[https://github.com/discourse/discourse-azure-blob-storage/pull/15](https://github.com/discourse/discourse-azure-blob-storage/pull/15)

Essentially, the `azure-storage-common` gem needs to bump a version because one of its dependencies now conflict with Discourse.

For those who can’t wait (I understand your feeling because if Azure Blob suddenly doesn’t work, you site is not coming back up or it loses all its contents), pull from my fork instead:

[https://github.com/schungx/discourse-azure-blob-storage](https://github.com/schungx/discourse-azure-blob-storage)

I don’t monitor meta as much as I used to, so I may not see these messages until months later. For those in need, raise an issue at my GitHub repo and I should respond.

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [February 20, 2021, 3:25pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/96 "2021-02-20T15:25:02Z")

</div>

Hopefully the PR will be merged in soon and the `broken-plugin` tag can be removed.

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [February 20, 2021, 3:27pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/97 "2021-02-20T15:27:59Z")

</div>

When this happens, it is usually errors during post-processing.

Check your `sidekiq` logs to see what’s blocking you from uploading to Azure.

---

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [March 29, 2021, 4:58am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/98 "2021-03-29T04:58:28Z")

</div>

Got a Unicorn error today when I rebuilt my app:

```plaintext
E, [2021-03-29T01:34:52.651460 #756] ERROR -- : app error: uninitialized constant IPAddr::PRIVATE_RANGES (NameError)
E, [2021-03-29T01:34:52.651585 #756] ERROR -- : /var/www/discourse/plugins/discourse-azure-blob-storage/gems/2.7.2/gems/azure-storage-common-2.0.2/lib/azure/storage/common/core/utility.rb:218:in `private?'
E, [2021-03-29T01:34:52.651600 #756] ERROR -- : /var/www/discourse/lib/middleware/request_tracker.rb:220:in `is_private_ip?'
E, [2021-03-29T01:34:52.651612 #756] ERROR -- : /var/www/discourse/lib/middleware/request_tracker.rb:233:in `rate_limit'
E, [2021-03-29T01:34:52.651640 #756] ERROR -- : /var/www/discourse/lib/middleware/request_tracker.rb:166:in `call'
E, [2021-03-29T01:34:52.651650 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.5/lib/rails/engine.rb:527:in `call'
E, [2021-03-29T01:34:52.651660 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.5/lib/rails/railtie.rb:190:in `public_send'
E, [2021-03-29T01:34:52.651670 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.5/lib/rails/railtie.rb:190:in `method_missing'
E, [2021-03-29T01:34:52.651681 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
E, [2021-03-29T01:34:52.651691 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
E, [2021-03-29T01:34:52.651753 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
E, [2021-03-29T01:34:52.651768 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:634:in `process_client'
E, [2021-03-29T01:34:52.651779 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:732:in `worker_loop'
E, [2021-03-29T01:34:52.651789 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
E, [2021-03-29T01:34:52.651802 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/unicorn-6.0.0/lib/unicorn/http_server.rb:143:in `start'
E, [2021-03-29T01:34:52.651816 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/unicorn-6.0.0/bin/unicorn:128:in `<top (required)>'
E, [2021-03-29T01:34:52.651830 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/bin/unicorn:23:in `load'
E, [2021-03-29T01:34:52.651843 #756] ERROR -- : /var/www/discourse/vendor/bundle/ruby/2.7.0/bin/unicorn:23:in `<main>'

```

I’ll look at this more tomorrow but the update above doesn’t seem to fix it.

@schungx

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 2, 2021, 7:29am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/99 "2021-04-02T07:29:40Z")

</div>

The error seems to complain that you’re using a private IP range?

---

<div class="post-metadata">

### Author: ![bsawicki](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bsawicki](https://meta.discourse.org/u/bsawicki)
#### Post date: [April 2, 2021, 8:41am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/100 "2021-04-02T08:41:05Z")

</div>

> [@bsawicki](#):
>
> `ERROR -- : app error: uninitialized constant IPAddr::PRIVATE_RANGES (NameError)`

Maybe I’m wrong but that suggests the constant PRIVATE\_RANGES isn’t initialized. That constant should be defined here:

> <https://github.com/Azure/azure-storage-ruby/blob/master/common/lib/azure/core/utility.rb#L197>

I’m not sure if this is a name conflict between the IPAddr class defined in the above utility.rb and that one defined in discourse itself but that would be my initial concern. I’m just not sure how I’d proceed in fixing that. My first thought would be submitting a PR that places the IPAddr class in discourse in a module. Any further thoughts?

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 4, 2021, 9:02am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/102 "2021-04-04T09:02:44Z")

</div>

> <https://github.com/Azure/azure-storage-ruby/blob/master/common/lib/azure/core/utility.rb#L221>

It seems the `private?` call is on line 221, instead of line 218 as in the error message.

So perhaps it is the wrong version?

The last version where line 218 makes sense is `1.1.0` where you can see is exactly the error position:

> <https://github.com/Azure/azure-storage-ruby/blob/v1.1.0-common/common/lib/azure/storage/common/core/utility.rb#L218>

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 26, 2021, 6:32am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/103 "2021-04-26T06:32:25Z")

</div>

OK, I’m really baffled here. Turns out that the plugin is still not correct.

Whenever it tries to store a file, it comes back with:

```plaintext
Blob can not be stored: missing dependency for Faraday::Adapter::NetHttpPersistent: cannot load such file -- net/http/persistent
Url: //chenhsongweb.blob.core.windows.net/support/original/2X/e/e5224c77df15646017fb5e4747576206c33904f6.jpeg

```

So obviously somewhere I’m missing a `require 'net/http/persistent'`, but I tried adding it to _everywhere_ and it still gives this error.

For example, I’m adding it to `plugin.rb` and `lib/azure_blob_store.rb`… still this error.

The error came from a call to `cache_file`:

```plaintext
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:27:in `rescue in store_file'
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:17:in `store_file'
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:9:in `store_upload'

```

Can some kind soul teach me how to get rid of the missing dependency error?

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 26, 2021, 8:33am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/104 "2021-04-26T08:33:09Z")

</div>

Ok. Could be needed in the rake task. I’ll add it and see…

EDIT: Nope. That’s not it.

It is failing at `upload_creator`…

```plaintext
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:25:in `rescue in store_file'
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:15:in `store_file'
/var/www/discourse/plugins/discourse-azure-blob-storage/lib/azure_blob_store.rb:7:in `store_upload'
/var/www/discourse/lib/upload_creator.rb:160:in `block (2 levels) in create_for'
/var/www/discourse/lib/upload_creator.rb:159:in `open'
/var/www/discourse/lib/upload_creator.rb:159:in `block in create_for'

```

Now I’m totally baffled. How do I get rid of that missing dependency error?

EDIT 2:

For some strange reason, when I click on the little arrow at the end of the stack trace, it brings me to `discourse/discourse-azure-blob-storage` instead of my own fork. I am quite sure I’m using my own fork in `app.config`.

EDIT 3:

I tried moving back a version to `azure-storage-common` 2.0.1 which does not use `net-http-persistent`, but then it uses `nokogiri` version `1.10` which conflicts with _something_ that requires version `1.11`… Arrrrhhhhhgggghhhh…

Anybody knows how to resolve nokogiri version conflicts?

@pfaffman do you have any ideas? 🙏

EDIT 4:

@maja not sure if you’re still following up on this plugin. As the original author you may have an idea what’s going on.

I have been baffled at an error for some time.

Recently it seems Discourse starts requiring `nokogiri` version `1.11`, which mandates updating to `azure-storage-common` version `2.0.1`. However, that version uses `net-http-persistent` to make HTTP calls (previous versions didn’t).

Every time an azure call is made, it fails with a missing dependency: `missing dependency for Faraday::Adapter::NetHttpPersistent: cannot load such file -- net/http/persistent`.

The strange thing is, even if I put `require 'net/http/persistent'` each time before the call, it still fails with the exact same error. Even though `require` returns `true` meaning that the module is loaded.

It seems to start happening during the _second_ time calling azure functions. For certain uploads, the _first_ time will succeed, and the second\_ time on will start giving missing dependency.

It almost feels like something is overwriting the `require` cache wiping out `net/http/persistent`.

EDIT 5:

Tried cloning `azure-storage-blob` and modifying to remove the `net-http-persistent` but can’t find a way to get Discourse to load from an alternative git repo… it seems always to be loading the official gem.

EDIT 6:

Update: There is a fix which works reasonably. However, it is still undergoing some further testing as it seems to conflict with other places.

The main error came from the fact that `Faraday` has its own dependency management system which conflicts with the Bundler.

The current solution basically just ignores the error from Faraday and loads the dependency statically. However, some kind soul may also point out a way to do it more elegantly…

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [August 19, 2021, 2:44am UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/105 "2021-08-19T02:44:25Z")

</div>

Alright, this plugin is so broken that there isn’t a point to continue with it.

I recommend everyone to uninstall this plugin and use `Flexify.IO` instead.

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916#azure-blob-storage-with-flexify-io):
>
> information_source This topic covers how to configure some common S3 compatible Object Storage providers (S3 clones). See [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229) for more details about Amazon AWS S3 configuration, which is officially supported and used internally by Discourse for our hosting services. Provider Service Name Works with Discourse? [Amazon AWS](#aws-s3-2) S3 Yes [Digital Ocean](#digital-ocean-spaces-3) Spaces Yes [Linode](#linode-object-storage-4) Object Storage Yes [Google Cloud](#google-cloud-platform-storage-5) Storage Yes [Scaleway](#scaleway-object-storage-6) Object Storage Yes [Vultr](#vultr-object-storage-7) Obj…

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [May 20, 2024, 12:08pm UTC](https://meta.discourse.org/t/azure-blob-storage-plugin/79392/106 "2024-05-20T12:08:52Z")

</div>



[Previous page](https://meta.discourse.org/t/azure-blob-storage-plugin/79392.md?page=4)
