gutschilla / plug-session-memcached Goto Github PK
View Code? Open in Web Editor NEWStore your plug sessions in memcached
License: MIT License
Store your plug sessions in memcached
License: MIT License
It seems that the both IP and port number are hard-coded in lib/plug_session_memcached.ex. Do you have any plan you allow to configure them through a configuration like following?
plug Plug.Session,
store: :memcached,
host: "memcached.example.jp",
port: 11211
When I download your package (from Github or Hex), I can download only plug_session_memcached.ex
file.
Your package has plug_session_memcached.ex
and plug_session_MEMCACHED.ex
, but file system of Mac OS X is case insensitive.
So I think one of your file is overwritten by another one when downloaded.
Incidentally, when I download your package on Amazon Linux, I can get both plug_session_memcached.ex
and plug_session_MEMCACHED.ex
.
I think you should use different file name.
I am trying to integrate memcached in my project. However, I get the following error:
Looking up alternatives for conflicting requirements on plug
From mix.lock: 1.0.3
From plug_session_memcached v0.2.6: ~> 0.13.0
** (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies
Here is my mix.exs:
defp deps do
[{:comeonin, ">1.6"},> 1.0.0"},
{:phoenix, "
{:phoenix_ecto, "> 1.1"},> 2.1"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "
{:phoenix_live_reload, "> 1.0", only: :dev},> 1.0"},
{:cowboy, "
{:httpoison, "> 0.7.2"},> 0.8.0"},
{:guardian, "
{:ua_inspector, "> 0.10" },> 0.2.0" }
{:yamerl, github: "yakaz/yamerl" },
{:plug_session_memcached, "
]
end
Here is my mix.lock:
%{"base64url": {:hex, :base64url, "0.0.1"},
"comeonin": {:hex, :comeonin, "1.6.0"},
"connection": {:hex, :connection, "1.0.2"},
"corman": {:git, "git://github.com/EchoTeam/corman.git", "e3c4c9f602441b4d9b8f9f8ea2813b3d791ec9e1", [branch: "master"]},
"cowboy": {:hex, :cowboy, "1.0.4"},
"cowlib": {:hex, :cowlib, "1.0.2"},
"decimal": {:hex, :decimal, "1.1.1"},
"dht_ring": {:git, "git://github.com/EchoTeam/dht_ring.git", "d5b880ad76aefc81547dbb76b48a97a01d52ff41", [branch: "master"]},
"ecto": {:hex, :ecto, "1.1.1"},
"fs": {:hex, :fs, "0.9.2"},
"goldrush": {:git, "git://github.com/DeadZen/goldrush.git", "1d883423ac360b3536ca52dc733a0164bacf3109", [tag: "0.1.5"]},
"guardian": {:hex, :guardian, "0.8.1"},
"hackney": {:hex, :hackney, "1.3.2"},
"httpoison": {:hex, :httpoison, "0.7.5"},
"idna": {:hex, :idna, "1.0.2"},
"joken": {:hex, :joken, "0.15.0"},
"jose": {:hex, :jose, "1.4.2"},
"lager": {:git, "git://github.com/basho/lager.git", "ad400896af5b1ad8b4f7a4d34e609b5a990640bb", [tag: "2.0.1"]},
"phoenix": {:hex, :phoenix, "1.0.4"},
"phoenix_ecto": {:hex, :phoenix_ecto, "1.2.0"},
"phoenix_html": {:hex, :phoenix_html, "2.3.0"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.0.1"},
"plug": {:hex, :plug, "1.0.3"},
"poison": {:hex, :poison, "1.5.0"},
"poolboy": {:hex, :poolboy, "1.5.1"},
"postgrex": {:hex, :postgrex, "0.10.0"},
"ranch": {:hex, :ranch, "1.2.0"},
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.6"},
"ua_inspector": {:hex, :ua_inspector, "0.10.0"},
"uuid": {:hex, :uuid, "1.1.2"},
"yamerl": {:git, "git://github.com/yakaz/yamerl.git", "ae810a808817d9482b4628ae3e20d746e3729fe0", []}}
I configured the plug as in the instructions. However, when I start my Phoenix server ("mix phoenix.server"), I receive the following error:
== Compilation error on file lib/video_backend/endpoint.ex ==
** (UndefinedFunctionError) undefined function: Plug.Session.MEMCACHED.init/1 (module Plug.Session.MEMCACHED is not available)
Plug.Session.MEMCACHED.init([table: :memcached_sessions, signing_salt: "123456", encryption_salt: "654321"])
(plug) lib/plug/session.ex:48: Plug.Session.init/1
(plug) lib/plug/builder.ex:198: Plug.Builder.init_module_plug/3
(plug) lib/plug/builder.ex:186: anonymous fn/4 in Plug.Builder.compile/3
(elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
(plug) lib/plug/builder.ex:186: Plug.Builder.compile/3
(phoenix) expanding macro: Phoenix.Endpoint.before_compile/1
lib/video_backend/endpoint.ex:1: VideoBackend.Endpoint (module)
(elixir) lib/kernel/parallel_compiler.ex:97: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8
They are giving me dependency hell. Why is there a markdown parser in a memcache session plug anyway?
a release version, built with mix release
doesn't work due to a crush.
You can reproduce the issue in these ways:
mix phoenix.new memcached_test --no-brunch --database mysql
mix.exs
MIX_ENV=prod mix do deps.get, compile
MIX_ENV=prod mix release
rel/memcached_test/bin/memcached_test console
The test project is here: https://github.com/hykw/phoenix-test-memcached
The messages are following(Also, I attach erl_crash.dump
, just in case)
$ MIX_ENV=prod mix release
Building release with MIX_ENV=prod.
You have dependencies (direct/transitive) which are not in :applications!
The following apps should to be added to :applications in mix.exs:
lager => lager is missing from memcached_test
Continue anyway? Your release may not work as expected if these dependencies are required! [Yn]:
==> The release for memcached_test-0.0.1 is ready!
==> You can boot a console running your release with `$ rel/memcached_test/bin/memcached_test console`
$ rel/memcached_test/bin/memcached_test console
Using /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/releases/0.0.1/memcached_test.sh
mkdir: created directory `/home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/running-config'
Exec: /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/erts-7.2.1/bin/erlexec -boot /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/releases/0.0.1/memcached_test -boot_var ERTS_LIB_DIR /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/erts-7.2.1/../lib -env ERL_LIBS /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/lib -config /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/running-config/sys.config -args_file /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test/running-config/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test
/home/hitoshi-hayakawa/moge/phoenix-test-memcached/rel/memcached_test
Erlang/OTP 18 [erts-7.2.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
{"Kernel pid terminated",application_controller,"{application_start_failure,plug_session_memcached,{bad_return,{{'Elixir.PlugSessionMemcached',start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,'Elixir.PlugSessionMemcached.Supervisor',{shutdown,{failed_to_start_child,mcd,{'EXIT',{undef,[{mcd,start_link,[memcached_sessions,[\"127.0.0.1\",11211]],[]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,343}]},{supervisor,start_children,3,[{file,\"supervisor.erl\"},{line,326}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,292}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,240}]}]}}}}}}}},[{'Elixir.PlugSessionMemcached',start,2,[{file,\"lib/plug_session_memcached.ex\"},{line,54}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}
Crash dump is being written to: erl_crash.dump...done
Kernel pid terminated (application_controller) ({application_start_failure,plug_session_memcached,{bad_return,{{'Elixir.PlugSessionMemcached',start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{
on linux in my deps lib dir I get:
-rw-rw-r-- 1 crispin crispin 2281 Jul 6 16:50 plug_session_memcached.ex
-rw-rw-r-- 1 crispin crispin 2116 Jul 6 16:50 plug_session_MEMCACHED.ex
but on mac OSX one file blats the other and the plugin doesn't work.
-rw-rw-r-- 1 crispin crispin 2116 Jul 6 16:53 plug_session_MEMCACHED.ex
I noticed you have merged the two files into one now.
Can you please tag and release a new version of this so it can work on macs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.