Ive upgraded using buildout from 4.0.5 to 4.1.3, but when I try to upgrade (first time login) I get this:
... ERROR plone.app.upgrade Upgrade aborted. Error:
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Products.CMFPlone-4.1.3-py2.6.egg/Products/CMFPlone/MigrationTool.py", line 175, in upgrade
step['step'].doStep(setup)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/upgrade.py", line 140, in doStep
self.handler(tool)
File "/usr/local/Plone/buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v41/alphas.py", line 105, in add_siteadmin_role
for permission_id, roles in state.permission_roles.items():
AttributeError: 'NoneType' object has no attribute 'items'
...ERROR plone.app.upgrade Migration has failed
Upgrading steps:
Current
4018
Latest
4112
(4018 → 4019)
* No upgrade steps
(4019 → 4020)
* No upgrade steps
(4020 → 4022)
* No upgrade steps
(4022 → 4100)
* Add Site Administrator role
* Update role mappings
* Update control panel permissions
* Install plone.outputfilters
* Miscellaneous
(4100 → 4101)
* Miscellaneous
(4101 → 4102)
* Miscellaneous
(4102 → 4103)
* Miscellaneous
(4103 → 4104)
* Miscellaneous
(4104 → 4105)
* Miscellaneous
(4105 → 4106)
* Miscellaneous
(4106 → 4107)
* Miscellaneous
(4107 → 4108)
* Miscellaneous
(4108 → 4109)
* Miscellaneous
(4109 → 4110)
* Fix OkapiIndex total document lengths
(4110 → 4111)
* Repair owner tuples
* Miscellaneous
(4111 → 4112)
* Miscellaneous
Vangheem:
I tried the second solution by adding
if state.permission_roles is None:
continue
to
../buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v41/alphas.py
I do not know if its a problem but there are several alphas.py:
[root#www /usr/local/Plone]# find . -type f -name 'alphas.py'
./buildout-cache/eggs/plone.app.upgrade-1.0.5-py2.6.egg/plone/app/upgrade/v30/alphas.py
./buildout-cache/eggs/plone.app.upgrade-1.0.5-py2.6.egg/plone/app/upgrade/v40/alphas.py
./buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v30/alphas.py
./buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v40/alphas.py
./buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v41/alphas.py
Anyway, I then did the migration and it got a lot better - I got this new error below though:
Role / permission map imported.
Step collective.blogging.reset-layers has an invalid import handler
Class Products.PloneboardSubscription.NotificationTool.NotificationTool not found for tool portal_pbnotification
Upgrade aborted. Error:
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Products.CMFPlone-4.1.3-py2.6.egg/Products/CMFPlone/MigrationTool.py", line 175, in upgrade
step['step'].doStep(setup)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/upgrade.py", line 140, in doStep
self.handler(tool)
File "/usr/local/Plone/buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/v41/betas.py", line 112, in to41beta2
loadMigrationProfile(context, 'profile-plone.app.upgrade.v41:to41beta2')
File "/usr/local/Plone/buildout-cache/eggs/plone.app.upgrade-1.1.4-py2.6.egg/plone/app/upgrade/utils.py", line 112, in loadMigrationProfile
context.runAllImportStepsFromProfile(profile, purge_old=False)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/tool.py", line 323, in runAllImportStepsFromProfile
ignore_dependencies=ignore_dependencies)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/tool.py", line 1084, in _runImportStepsFromContext
message = self._doRunImportStep(step, context)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/tool.py", line 998, in _doRunImportStep
return handler(context)
File "/usr/local/Plone/buildout-cache/eggs/Products.GenericSetup-1.6.4-py2.6.egg/Products/GenericSetup/tool.py", line 123, in importToolset
new_tool = tool_class(tool_id)
TypeError: 'NoneType' object is not callable
End of upgrade path, migration has finished
The upgrade path did NOT reach current version
Migration has failed
END
NB before the upgrade I removed Products.PloneboardSubscription from add-on and made an uninstall. Also I removed collective.blogging long time ago. Somehow there are still some references to it when trying to migrate:
There are unresolved or circular dependencies. Graphviz diagram:: digraph dependencies {"typeinfo" -> "toolset"; "tinymce_settings" -> "componentregistry"; "kss_mimetype" -> "mimetypes-registry-various"; "collective.blogging.reset-roles";"atcttool" -> "catalog"; "atcttool" -> "componentregistry"; "actions" -> "componentregistry"; "skins" -> "componentregistry"; "languagetool" -> "toolset"; "factorytool" -> "componentregistry"; "factorytool" -> "typeinfo"; "ploneboard-various" -> "toolset"; "ploneboard-various" -> "typeinfo"; "ploneboard-various" -> "placeful_workflow"; "placeful_workflow" -> "typeinfo"; "placeful_workflow" -> "workflow"; "portal-transforms-various" -> "componentregistry"; "componentregistry" -> "toolset"; "plone.app.caching";"controlpanel" -> "actions"; "controlpanel" -> "componentregistry"; "placeful_marker" -> "workflow"; "jsregistry" -> "toolset"; "jsregistry" -> "componentregistry"; "action-icons" -> "componentregistry"; "plone.app.registry" -> "componentregistry"; "plone.app.registry" -> "toolset"; "mimetypes-registry-various" -> "componentregistry"; "reference_catalog" -> "toolset"; "viewlets" -> "componentregistry"; "content" -> "typeinfo"; "collective.blogging.reset-catalog";"propertiestool" -> "componentregistry"; "various" -> "toolset"; "collective.blogging.reset-views";"portlets" -> "componentregistry"; "portlets" -> "content"; "content_type_registry" -> "componentregistry"; "plone-final" -> "kss_mimetype"; "plone-final" -> "portlets"; "plone-final" -> "rolemap"; "kssregistry" -> "toolset"; "kssregistry" -> "componentregistry"; "poi_various" -> "catalog"; "ploneopenid-various";"update-workflow-rolemap" -> "workflow"; "sharing" -> "rolemap"; "uid_catalog" -> "toolset"; "workflow" -> "toolset"; "collective.plonetruegallery.install";"cssregistry" -> "toolset"; "cssregistry" -> "componentregistry"; "contentrules" -> "componentregistry"; "contentrules" -> "content"; "catalog" -> "toolset"; "simpleattachment" -> "properties"; "simpleattachment" -> "typeinfo"; "cookie_authentication" -> "toolset"; "cmfeditions_various" -> "toolset"; "cmfeditions_various" -> "typeinfo"; "difftool" -> "toolset"; "difftool" -> "componentregistry"; "plone-content" -> "plone-final"; "toolset";"properties";"collective.blogging.reset-layers";"plonepas" -> "componentregistry"; "plonepas" -> "controlpanel"; "plonepas" -> "memberdata-properties"; "plonepas" -> "plonepas-contents"; "plonepas" -> "rolemap"; "jquerytools-various" -> "cssregistry"; "tinymce_various" -> "componentregistry"; "browserlayer" -> "componentregistry"; "plone-difftool";"plone_outputfilters_various" -> "componentregistry"; "memberdata-properties" -> "componentregistry"; "Products.EasyNewsletter-setuphandlers";"plonetheme.sunburst-various" -> "actions"; "caching_policy_mgr" -> "toolset"; "archetypetool" -> "archetypes-various"; "mailhost" -> "componentregistry"; "repositorytool" -> "toolset"; "repositorytool" -> "typeinfo"; "repositorytool" -> "cmfeditions_various"; "Products.Ploneboard.uninstallVarious";"various-calendar" -> "toolset"; "collective.flowplayer" -> "kupu-setup"; "collective.flowplayer" -> "propertiestool"; "kupu-setup" -> "toolset"; "kupu-setup" -> "typeinfo"; "archetypes-various" -> "componentregistry"; "rolemap";"plonepas" [color=red,style=filled]; }
Thanks.
Nikolaj G.
This was fixed with this commit: https://github.com/plone/plone.app.upgrade/commit/df61c3b4eabaf2cacb1f57bf1cd06e035d19ece9
If you do a check out of this branch:
https://github.com/plone/plone.app.upgrade/tree/1.1
install it and then run the upgrade, you should be good.
Others have reported similar errors before... see http://plone.293351.n2.nabble.com/migration-from-plone-4-0-10-to-plone-4-1-3-fails-td7055584.html for one solution.
Related
I am following the book "Learn me some Erlang". I have installed eclipse on my windows machine in order to run the scripts, and I came across an error on runtime:
** exception error: bad argument
Apparently this error is caused by nodes having the same name on repeated restarts within the judge2 function, third line.
However, I am not sure how to correct the problem.
Here is my code:
start_critic2() ->
spawn(?MODULE, restarter, []).
restarter() ->
process_flag(trap_exit, true),
Pid = spawn_link(?MODULE, critic, []),
receive
{'EXIT', Pid, normal} -> % not a crash
ok;
{'EXIT', Pid, shutdown} -> % manual termination, not a crash
ok;
{'EXIT', Pid, _} ->
restarter()
end.
judge2(Band, Album) ->
Ref = make_ref(),
critic ! {self(), Ref, {Band, Album}},
receive
{Ref, Criticism} -> Criticism
after 2000 ->
timeout
end.
critic2() ->
receive
{From, Ref, {"Rage Against the Turing Machine", "Unit Testify"}} ->
From ! {Ref, "They are great!"};
{From, Ref, {"System of a Downtime", "Memoize"}} ->
From ! {Ref, "They're not Johnny Crash but they're good."};
{From, Ref, {"Johnny Crash", "The Token Ring of Fire"}} ->
From ! {Ref, "Simply incredible."};
{From, Ref, {_Band, _Album}} ->
From ! {Ref, "They are terrible!"}
end,
critic2().
I am quite new to selenium IDE.
I try to read from an XML file.
I saw the error on this site but it was not answered (It was stated that the error was with the xml file used, but that seems not to be the case)
The complete error I got is:
[error] Unexpected Exception: [Exception... "The URI scheme
corresponds to an unknown protocol handler" nsresult: "0x804b0012
(NS_ERROR_UNKNOWN_PROTOCOL)" location: "JS frame ::
chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072 ::
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest ::
line 81" data: no]. toString -> function toString() { [native code] },
message -> , result -> 2152398866, name -> NS_ERROR_UNKNOWN_PROTOCOL,
filename -> chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072, lineNumber -> 81,
columnNumber -> 0, inner -> null, data -> null, stack ->
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest#chrome://selenium-ide/content/tools.js
-> file:///C:/Rommel/user-extensions.js?1447329745072:81:5 xmlTestData.prototype.load#chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/datadriven.js?1447329745073:53:19
Selenium.prototype.doLoadTestData#chrome://selenium-ide/content/tools.js
-> file:///C:/Rommel/datadriven.js?1447329745073:102:2 fnBind/retval#chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60:12
ActionHandler.prototype.execute#chrome://selenium-ide/content/selenium-core/scripts/selenium-commandhandlers.js:314:28
._executeCurrentCommand#chrome://selenium-ide/content/selenium-runner.js:306:19
TestLoop.prototype.resume#chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:78:13
fnBind/retval#chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60:12
, location -> JS frame :: chrome://selenium-ide/content/tools.js ->
file:///C:/Rommel/user-extensions.js?1447329745072 ::
IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest ::
line 81
I got it with the selenium IDE command: loadTestData
<tr>
<td>loadTestData</td>
<td>C:\Rommel\test_data_file.xml</td>
<td></td>
</tr>
The XML file is this:
<testdata>
<test employee="1" type="1" startDate="01.01.2013" endDate="01.02.2013" />
<test employee="2" type="1" startDate="01.02.2013" endDate="01.03.2013" />
<test employee="3" type="1" startDate="01.03.2013" endDate="01.04.2013" />
</testdata>
I use the next user extension files:
sideflow.js, include.js, datadriven.js, goto_sel_ide.js.
Somewhere I read that the order of the extension files was important but changing the order did not solve the issue.
If I leave the filename blank the error persists, so my conclusion is that the error is not because of the content of the XML file.
I also tried to get the extension files form different sites, but they all seem to be the same.
Help would be very much appreciated.
Solved: after a day of frustration ... I needed to use the filepath: file:///C:/Rommel/test_data_file.xml
instead of
C:\Rommel\test_data_file.xml
I Wrote this module for a simple server program that receives a request and send a response to client. It works fine But when if recompile this module while a client connected, the client disconnects and if i reconnect client to this server and send a request, there is no response. Is there any idea?!
Here is my module:
-module(controller).
-export([start/1, loop/1, response/2]).
-include_lib("types.hrl").
-define(END_CHAR, "$").
-spec start(Port) -> no_return() when
Port :: char().
-spec loop(Listen) -> no_return() when
Listen :: port().
-spec handler(Socket) -> no_return() when
Socket :: port().
-spec response(HandlerPID, Data) -> {send_msg, Msg} when
HandlerPID :: pid(),
Data :: string(),
Msg :: response().
start(Port) ->
{ok, Listen} = gen_tcp:listen(Port, [{active, once}]),
spawn(?MODULE, loop, [Listen]).
loop(Listen) ->
{ok, Socket} = gen_tcp:accept(Listen),
spawn(?MODULE, loop, [Listen]),
handler(Socket).
handler(Socket) ->
receive
{tcp, Socket, Data} ->
%io:format("recv ~p~n", [Data]),
spawn(?MODULE, response, [self(), Data]),
inet:setopts(Socket, [{active, once}]),
handler(Socket);
{tcp_closed, Socket} ->
%io:format("disconnected~n", []),
gen_tcp:close(Socket);
{send_msg, Msg} ->
gen_tcp:send(Socket, lists:flatten(io_lib:format("~p", [Msg])) ++ ?END_CHAR),
handler(Socket)
end.
response(PID, Data) ->
[Req|Args] = string:tokens(Data, ?END_CHAR),
{ReqPID, ReqRef} = spawn_monitor(view, request, [list_to_atom(Req), self(), Args]),
receive
{'DOWN', ReqRef, process, ReqPID, {function_clause, _}} -> PID ! {send_msg, invalid_request};
{'DOWN', ReqRef, process, ReqPID, {{case_clause, _}, _}} -> PID ! {send_msg, bad_args};
{'DOWN', ReqRef, process, ReqPID, {{badmatch, _}, _}} -> PID ! {send_msg, bad_args};
Resp -> PID ! {send_msg, Resp}
end.
Note
{tcp_closed, Socket} ->
%io:format("disconnected~n", []),
gen_tcp:close(Socket);
in handler. It doesn't call handler again, it just returns and so the server process stops.
Your loop function name is also misleading, handler is the actual loop.
I would recommend to take a look at Ranch - A socket acceptor pool for the TCP connections.
I found this when reading the warp source code.
-- | Run an 'Application' with the given 'Settings'.
runSettings :: Settings -> Application -> IO ()
runSettings set app = withSocketsDo $
bracket
(bindPortTCP (settingsPort set) (settingsHost set))
sClose
(\socket -> do
setSocketCloseOnExec socket
runSettingsSocket set socket app)
-- Copied from: https://github.com/mzero/plush/blob/master/src/Plush/Server/Warp.hs
setSocketCloseOnExec :: Socket -> IO ()
#if WINDOWS
setSocketCloseOnExec _ = return ()
#else
setSocketCloseOnExec socket =
setFdOption (fromIntegral $ fdSocket socket) CloseOnExec True
#endif
Sockets used by the web server need to be set so that they are not leaked into processes fork/exec'd by the shell.
However, acceptFork in Network.Simple.TCP module does not set CloseOnExec option. Shouldn't this option be the default?
Im working on erlang for the first time. everytime i try to run the erlang process it gets stuck and does not take input. Im using erlide plugin in eclipse to test the erlang code.
CODE IS::
-module(message_router).
%% ====================================================================
%% API functions
%% ====================================================================
%%-compile(export_all).
-export([start/0]).
-export([stop/1]).
-export([send_chat_message/3]).
-export([route_messages/0]).
%% ====================================================================
%% Internal functions
%% ====================================================================
start() ->
spawn(message_router, route_messages, []).
stop(RouterPid) ->
RouterPid ! shutdown.
send_chat_message(RouterPid, Addressee, MessageBody) ->
io:format("send_chat_msg FROM:: ~p TO:: ~p ~n", [RouterPid, Addressee]),
RouterPid ! {send_chat_msg, Addressee, MessageBody}.
route_messages() ->
receive
{send_chat_msg, Addressee, MessageBody} ->
io:format("recv_chat_msg PID:: ~p ~n", [Addressee]),
Addressee ! {recv_chat_msg, MessageBody},
route_messages();
{recv_chat_msg, MessageBody} ->
io:format("Received: ~p~n", [MessageBody]);
shutdown ->
io:format("Shutting down ~n");
Oops ->
io:format("Warning! Received: ~p~n", [Oops]),
route_messages()
end.
When i hit try to run the code like in the shell
Eshell V5.10.4
(nodename#pa)1> P1 = message_router:start().
<0.1308.0>
(nodename#pa)2> P2 = message_router:start().
<0.1373.0>
(nodename#pa)3> chat_client:send_message(P1, P2, "FIRST Msg").
Sending chat message from chat_client
send_chat_msg FROM:: <0.1308.0> TO:: <0.1373.0>
Every thing i enter in the shell after this has on effect. Also could anyone explain how loops are handled in erlang and best practices.
[edit]
chat client code:
-module(chat_client).
-export([send_message/3]).
send_message(RouterPid, Addressee, MessageBody) ->
io:format("Sending chat message from chat_client~n"),
message_router:send_chat_message(RouterPid, Addressee, MessageBody).
Problem in module. Call this message_router:send_chat_message(P1, P2, "FIRST Msg")
Look at this example and compare with his:
Have module call observer it registers two process loop/0 and trans/0
-module(observer).
-export([observer/0, loop/0, trans/0]).
observer() ->
register(loop, spawn(fun observer:loop/0)),
register(trans, spawn(fun observer:trans/0)).
loop() ->
receive
{'PRINT', Msg} ->
io:format("print from ~p~n~p~n", [self(), Msg]), loop();
{'EXIT', _FromPid} ->
io:format("Exit ~nFrom ~p", [_FromPid]), exit(self(), kill)
end.
trans() ->
receive
{Command, Msg} -> io:format("transports from: ~p~n~p~n", [self(), Msg]),
loop ! {Command, Msg}
end.
and have module send_messenger one function send_message that sends messages through trans:
-module(send_messenger).
-export([send_message/1]).
send_message({Command, Msg}) ->
trans ! {Command, Msg},
ok.
I hope this has helped you!