stop and run again an application in erlang - erlang
have an application developed in Erlang and to run this application I need to do: ./build.sh && ./deploy.sh && ./erl_start.sh
I want to make a function that will do the same thing as Ctrl + C and run ./build.sh && ./deploy.sh && ./erl_start.sh
meaning stop the application and run again this application
I try with this function :
verify(Val)->
if Val =:=40 ->
Pid = self(),
io:format("~w~n",[Pid]),
spawn(fun() -> exit(Pid, kill) end),
LsOut = os:cmd("./build.sh && ./deploy.sh && ./erl_start.sh");
true -> ok
end.
and when I test this function I have this error :
1> model:verify(40).
<0.144.0>
** exception exit: killed
I test this command :
1> [io:format("~p : ~p~n",[Pid,erlang:process_info(Pid,current_function)]) || Pid <- processes()].
<0.0.0> : {current_function,{init,loop,1}}
<0.3.0> : {current_function,{erl_prim_loader,loop,3}}
<0.5.0> : {current_function,{gen_event,fetch_msg,5}}
<0.6.0> : {current_function,{gen_server,loop,6}}
<0.8.0> : {current_function,{application_master,main_loop,2}}
<0.9.0> : {current_function,{application_master,loop_it,4}}
<0.10.0> : {current_function,{gen_server,loop,6}}
<0.11.0> : {current_function,{gen_server,loop,6}}
<0.12.0> : {current_function,{gen_server,loop,6}}
<0.13.0> : {current_function,{global,loop_the_locker,1}}
<0.14.0> : {current_function,{global,collect_deletions,2}}
<0.15.0> : {current_function,{global,loop_the_registrar,0}}
<0.16.0> : {current_function,{gen_server,loop,6}}
<0.18.0> : {current_function,{gen_server,loop,6}}
<0.19.0> : {current_function,{gen_server,loop,6}}
<0.20.0> : {current_function,{code_server,loop,1}}
<0.21.0> : {current_function,{gen_server,loop,6}}
<0.22.0> : {current_function,{standard_error,server_loop,1}}
<0.23.0> : {current_function,{gen_server,loop,6}}
<0.24.0> : {current_function,{user_drv,server_loop,5}}
<0.25.0> : {current_function,{group,server_loop,3}}
<0.26.0> : {current_function,{group,server_loop,3}}
<0.27.0> : {current_function,{shell,shell_rep,4}}
<0.28.0> : {current_function,{gen_server,loop,6}}
<0.29.0> : {current_function,{gen_server,loop,6}}
<0.36.0> : {current_function,{application_master,main_loop,2}}
<0.37.0> : {current_function,{application_master,loop_it,4}}
<0.38.0> : {current_function,{gen_server,loop,6}}
<0.39.0> : {current_function,{gen_event,fetch_msg,5}}
<0.40.0> : {current_function,{gen_server,loop,6}}
<0.41.0> : {current_function,{gen_server,loop,6}}
<0.44.0> : {current_function,{gen_server,loop,6}}
<0.45.0> : {current_function,{mnesia_locker,loop,1}}
<0.46.0> : {current_function,{gen_server,loop,6}}
<0.47.0> : {current_function,{mnesia_tm,doit_loop,1}}
<0.48.0> : {current_function,{gen_server,loop,6}}
<0.49.0> : {current_function,{gen_server,loop,6}}
<0.53.0> : {current_function,{gen_server,loop,6}}
<0.54.0> : {current_function,{gen_server,loop,6}}
<0.63.0> : {current_function,{disk_log,loop,1}}
<0.65.0> : {current_function,{gen_server,loop,6}}
<0.66.0> : {current_function,{gen_server,loop,6}}
<0.67.0> : {current_function,{gen_server,loop,6}}
<0.68.0> : {current_function,{gen_server,loop,6}}
<0.69.0> : {current_function,{mnesia_late_loader,loop,1}}
<0.105.0> : {current_function,{application_master,main_loop,2}}
<0.106.0> : {current_function,{application_master,loop_it,4}}
<0.107.0> : {current_function,{gen_server,loop,6}}
<0.108.0> : {current_function,{gen_server,loop,6}}
<0.109.0> : {current_function,{gen_server,loop,6}}
<0.110.0> : {current_function,{gen_server,loop,6}}
<0.111.0> : {current_function,{gen_server,loop,6}}
<0.112.0> : {current_function,{gen_server,loop,6}}
<0.113.0> : {current_function,{gen_server,loop,6}}
<0.114.0> : {current_function,{gen_server,loop,6}}
<0.115.0> : {current_function,{gen_server,loop,6}}
<0.117.0> : {current_function,{gen_server,loop,6}}
<0.118.0> : {current_function,{gen_server,loop,6}}
<0.119.0> : {current_function,{gen_server,loop,6}}
<0.120.0> : {current_function,{gen_server,loop,6}}
<0.121.0> : {current_function,{prim_inet,accept0,2}}
<0.123.0> : {current_function,{gen_server,loop,6}}
<0.124.0> : {current_function,{gen_server,loop,6}}
<0.125.0> : {current_function,{gen_server,loop,6}}
<0.126.0> : {current_function,{gen_server,loop,6}}
<0.127.0> : {current_function,{prim_inet,accept0,2}}
<0.129.0> : {current_function,{gen_server,loop,6}}
<0.130.0> : {current_function,{gen_server,loop,6}}
<0.131.0> : {current_function,{gen_server,loop,6}}
<0.132.0> : {current_function,{gen_server,loop,6}}
<0.133.0> : {current_function,{prim_inet,accept0,2}}
<0.135.0> : {current_function,{gen_server,loop,6}}
<0.136.0> : {current_function,{gen_server,loop,6}}
<0.137.0> : {current_function,{gen_server,loop,6}}
<0.138.0> : {current_function,{gen_server,loop,6}}
<0.139.0> : {current_function,{prim_inet,accept0,2}}
<0.140.0> : {current_function,{gen_server,loop,6}}
<0.143.0> : {current_function,{os,start_port_srv_loop,2}}
<0.144.0> : {current_function,{erl_eval,do_apply,5}}
[ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,
ok,ok,ok,ok,ok,ok,ok,ok,ok,ok|...]
and also I test this command :
1> [io:format("~p : ~p~n",[Pid,erlang:process_info(Pid,initial_call)]) || Pid <- processes()].
<0.0.0> : {initial_call,{otp_ring0,start,2}}
<0.3.0> : {initial_call,{erlang,apply,2}}
<0.5.0> : {initial_call,{proc_lib,init_p,5}}
<0.6.0> : {initial_call,{erlang,apply,2}}
<0.8.0> : {initial_call,{proc_lib,init_p,5}}
<0.9.0> : {initial_call,{application_master,start_it,4}}
<0.10.0> : {initial_call,{proc_lib,init_p,5}}
<0.11.0> : {initial_call,{proc_lib,init_p,5}}
<0.12.0> : {initial_call,{proc_lib,init_p,5}}
<0.13.0> : {initial_call,{erlang,apply,2}}
<0.14.0> : {initial_call,{erlang,apply,2}}
<0.15.0> : {initial_call,{erlang,apply,2}}
<0.16.0> : {initial_call,{proc_lib,init_p,5}}
<0.18.0> : {initial_call,{proc_lib,init_p,5}}
<0.19.0> : {initial_call,{proc_lib,init_p,5}}
<0.20.0> : {initial_call,{erlang,apply,2}}
<0.21.0> : {initial_call,{proc_lib,init_p,5}}
<0.22.0> : {initial_call,{standard_error,server,2}}
<0.23.0> : {initial_call,{proc_lib,init_p,5}}
<0.24.0> : {initial_call,{user_drv,server,2}}
<0.25.0> : {initial_call,{group,server,3}}
<0.26.0> : {initial_call,{group,server,3}}
<0.27.0> : {initial_call,{erlang,apply,2}}
<0.28.0> : {initial_call,{proc_lib,init_p,5}}
<0.29.0> : {initial_call,{proc_lib,init_p,5}}
<0.36.0> : {initial_call,{proc_lib,init_p,5}}
<0.37.0> : {initial_call,{application_master,start_it,4}}
<0.38.0> : {initial_call,{proc_lib,init_p,5}}
<0.39.0> : {initial_call,{proc_lib,init_p,5}}
<0.40.0> : {initial_call,{proc_lib,init_p,5}}
<0.41.0> : {initial_call,{proc_lib,init_p,5}}
<0.44.0> : {initial_call,{proc_lib,init_p,5}}
<0.45.0> : {initial_call,{proc_lib,init_p,5}}
<0.46.0> : {initial_call,{proc_lib,init_p,5}}
<0.47.0> : {initial_call,{proc_lib,init_p,5}}
<0.48.0> : {initial_call,{proc_lib,init_p,5}}
<0.49.0> : {initial_call,{proc_lib,init_p,5}}
<0.53.0> : {initial_call,{proc_lib,init_p,5}}
<0.54.0> : {initial_call,{proc_lib,init_p,5}}
<0.63.0> : {initial_call,{proc_lib,init_p,5}}
<0.65.0> : {initial_call,{proc_lib,init_p,5}}
<0.66.0> : {initial_call,{proc_lib,init_p,5}}
<0.67.0> : {initial_call,{proc_lib,init_p,5}}
<0.68.0> : {initial_call,{proc_lib,init_p,5}}
<0.69.0> : {initial_call,{proc_lib,init_p,5}}
<0.105.0> : {initial_call,{proc_lib,init_p,5}}
<0.106.0> : {initial_call,{application_master,start_it,4}}
<0.107.0> : {initial_call,{proc_lib,init_p,5}}
<0.108.0> : {initial_call,{proc_lib,init_p,5}}
<0.109.0> : {initial_call,{proc_lib,init_p,5}}
<0.110.0> : {initial_call,{proc_lib,init_p,5}}
<0.111.0> : {initial_call,{proc_lib,init_p,5}}
<0.112.0> : {initial_call,{proc_lib,init_p,5}}
<0.113.0> : {initial_call,{proc_lib,init_p,5}}
<0.114.0> : {initial_call,{proc_lib,init_p,5}}
<0.115.0> : {initial_call,{proc_lib,init_p,5}}
<0.117.0> : {initial_call,{proc_lib,init_p,5}}
<0.118.0> : {initial_call,{proc_lib,init_p,5}}
<0.119.0> : {initial_call,{proc_lib,init_p,5}}
<0.120.0> : {initial_call,{proc_lib,init_p,5}}
<0.121.0> : {initial_call,{proc_lib,init_p,5}}
<0.123.0> : {initial_call,{proc_lib,init_p,5}}
<0.124.0> : {initial_call,{proc_lib,init_p,5}}
<0.125.0> : {initial_call,{proc_lib,init_p,5}}
<0.126.0> : {initial_call,{proc_lib,init_p,5}}
<0.127.0> : {initial_call,{proc_lib,init_p,5}}
<0.129.0> : {initial_call,{proc_lib,init_p,5}}
<0.130.0> : {initial_call,{proc_lib,init_p,5}}
<0.131.0> : {initial_call,{proc_lib,init_p,5}}
<0.132.0> : {initial_call,{proc_lib,init_p,5}}
<0.133.0> : {initial_call,{proc_lib,init_p,5}}
<0.135.0> : {initial_call,{proc_lib,init_p,5}}
<0.136.0> : {initial_call,{proc_lib,init_p,5}}
<0.137.0> : {initial_call,{proc_lib,init_p,5}}
<0.138.0> : {initial_call,{proc_lib,init_p,5}}
<0.139.0> : {initial_call,{proc_lib,init_p,5}}
<0.140.0> : {initial_call,{proc_lib,init_p,5}}
<0.143.0> : {initial_call,{erlang,apply,2}}
<0.144.0> : {initial_call,{erlang,apply,2}}
[ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,ok,
ok,ok,ok,ok,ok,ok,ok,ok,ok,ok|...]
I try with this function :
verify(Val) ->
erlang:halt();
verify(_) ->
% do nothing
ok.
and when I test I have this result :
1> model:verify(40).
root#ubuntu:/home/afif/Desktop/ttest/erlang#
it only exit the VM
but as I already said I want to stop the application and run again this application
and for this I try with :
verify(Val) ->
erlang:halt(),
LsOut = os:cmd("./build.sh && ./deploy.sh && ./erl_start.sh");
verify(_) ->
% do nothing
ok.
but I have the same result like the previous code
what I've done is half of work
remains how to run the program again
If you only want to exit the VM in order to restart, you can use the function erlang:halt() or erlang:halt(Status). From the documentation:
halt()
Halts the Erlang runtime system and indicates normal exit to the
calling environment. Has no return value.
halt().
os_prompt%
halt(Status)
Types:
Status = integer() >= 0 | string()
Status must be a non-negative integer, or a string. Halts the Erlang
runtime system. Has no return value. If Status is an integer, it is
returned as an exit status of Erlang to the calling environment. If
Status is a string, produces an Erlang crash dump with String as
slogan, and then exits with a non-zero status code.
Note that on many platforms, only the status codes 0-255 are supported
by the operating system.
so your code could be:
verify(40) ->
erlang:halt();
verify(_) ->
% do nothing
ok.
But as I told you in your previous question, I don't think that you are looking in the good direction.
Related
Buildable libraries cannot import or export from non-buildable libraries (eslint)
I am getting above error when i import the interface from one of the library: import { DetailsProps } from '#vite/prop-types'; //error import styles from './header.module.less'; const initailDetails: DetailsProps = { name: 'Arif', city: 'Chennai', pin: 600019, }; export function Header() { return ( <div className={styles['container']}> <h1>Welcome to Header!</h1> <ul> {Object.values(initailDetails).map((v) => ( <li key={v}>{v}</li> ))} </ul> </div> ); } Nx report: Node : 16.13.2 OS : darwin arm64 npm : 8.1.2 nx : 15.3.3 #nrwl/angular : Not Found #nrwl/cypress : 15.3.3 #nrwl/detox : Not Found #nrwl/devkit : 15.3.3 #nrwl/esbuild : Not Found #nrwl/eslint-plugin-nx : 15.3.3 #nrwl/expo : Not Found #nrwl/express : Not Found #nrwl/jest : Not Found #nrwl/js : 15.3.3 #nrwl/linter : 15.3.3 #nrwl/nest : Not Found #nrwl/next : Not Found #nrwl/node : Not Found #nrwl/nx-cloud : Not Found #nrwl/nx-plugin : Not Found #nrwl/react : 15.3.3 #nrwl/react-native : Not Found #nrwl/rollup : Not Found #nrwl/schematics : Not Found #nrwl/storybook : Not Found #nrwl/web : Not Found #nrwl/webpack : Not Found #nrwl/workspace : 15.3.3 typescript : 4.8.4 --------------------------------------- Local workspace plugins: --------------------------------------- Community plugins: #nrwl/vite: 15.3.3
This is because of the linter, you can disable it by setting false for enforceBuildableLibDependency in .eslintrc.json file. or you can disable it by adding this comment before importing it: // eslint-disable-next-line #nrwl/nx/enforce-module-boundaries import { DetailsProps } from '#vite/prop-types';
Apple Store We were unable to review your app as it crashed on launch
My Xamarin iOS App, Works great in the simulator, but when i publish to the apple store i get this error: Guideline 2.1 - Performance - App Completeness We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue. Heres the error log: {"app_name":"ProyectoAngela.Prism.iOS","timestamp":"2022-01-14 10:33:37.00 -0800","app_version":"1.3","slice_uuid":"0725ebef-24d0-3dd4-aba2-bd0283b254a8","adam_id":"1604093951","build_version":"1.3","platform":2,"bundleID":"com.mxxx.xxxx","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"iPhone OS 15.2 (19C56)","incident_id":"C23408FA-A088-4955-9454-2BD6CA8A371E","name":"ProyectoAngela.Prism.iOS"} { "uptime" : 2400000, "procLaunch" : "2022-01-14 10:33:34.8287 -0800", "procRole" : "Foreground", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "iPad7,5", "procStartAbsTime" : 59878077029641, "coalitionID" : 5657, "osVersion" : { "isEmbedded" : true, "train" : "iPhone OS 15.2", "releaseType" : "User", "build" : "19C56" }, "captureTime" : "2022-01-14 10:33:36.5764 -0800", "incident" : "C23408FA-A088-4955-9454-2BD6CA8A371E", "bug_type" : "309", "pid" : 24812, "procExitAbsTime" : 59878118842372, "cpuType" : "ARM-64", "procName" : "ProyectoAngela.Prism.iOS", "procPath" : "\/private\/var\/containers\/Bundle\/Application\/3F629218-B618-43E2-A456-6AF0F4B6132B\/ProyectoAngela.Prism.iOS.app\/ProyectoAngela.Prism.iOS", "bundleInfo" : {"CFBundleShortVersionString":"1.3","CFBundleVersion":"1.3","CFBundleIdentifier":"com.mxxx.xxxx","DTAppStoreToolsBuild":"13C90b"}, "storeInfo" : {"itemID":"1604093951","deviceIdentifierForVendor":"F13E8B85-5D9C-4C8E-885D-4550BE2D0EB1","thirdParty":true,"softwareVersionExternalIdentifier":"43806246"}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "com.mxxx.xxxx", "crashReporterKey" : "36c14055bb17c6d0db3f456869338332b769d45e", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, "ktriageinfo" : "VM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\n", "asi" : {"libsystem_c.dylib":["abort() called"]}, "lastExceptionBacktrace" : [{"imageOffset":597308,"symbol":"__exceptionPreprocess","symbolLocation":216,"imageIndex":4},{"imageOffset":83624,"symbol":"objc_exception_throw","symbolLocation":56,"imageIndex":5},{"imageOffset":1190300,"symbol":"_userInfoForFileAndLine","symbolLocation":0,"imageIndex":12},{"imageOffset":5034496,"symbol":"-[UIApplication _runWithMainScene:transitionContext:completion:]","symbolLocation":2028,"imageIndex":10},{"imageOffset":3381572,"symbol":"-[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:]","symbolLocation":148,"imageIndex":10},{"imageOffset":1694148,"symbol":"_UIScenePerformActionsWithLifecycleActionMask","symbolLocation":96,"imageIndex":10},{"imageOffset":2890720,"symbol":"__101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke","symbolLocation":196,"imageIndex":10},{"imageOffset":4031172,"symbol":"-[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:]","symbolLocation":240,"imageIndex":10},{"imageOffset":6307680,"symbol":"-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]","symbolLocation":732,"imageIndex":10},{"imageOffset":5847968,"symbol":"-[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:]","symbolLocation":336,"imageIndex":10},{"imageOffset":1697964,"symbol":"__186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke","symbolLocation":188,"imageIndex":10},{"imageOffset":2468940,"symbol":"+[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:]","symbolLocation":812,"imageIndex":10},{"imageOffset":1705532,"symbol":"_UISceneSettingsDiffActionPerformChangesWithTransitionContext","symbolLocation":248,"imageIndex":10},{"imageOffset":2645692,"symbol":"-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]","symbolLocation":356,"imageIndex":10},{"imageOffset":7212472,"symbol":"__64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.576","symbolLocation":772,"imageIndex":10},{"imageOffset":1894672,"symbol":"-[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:]","symbolLocation":248,"imageIndex":10},{"imageOffset":2164592,"symbol":"-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]","symbolLocation":264,"imageIndex":10},{"imageOffset":3400924,"symbol":"-[UIApplication workspace:didCreateScene:withTransitionContext:completion:]","symbolLocation":548,"imageIndex":10},{"imageOffset":2638552,"symbol":"-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:]","symbolLocation":360,"imageIndex":10},{"imageOffset":158380,"symbol":"-[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:]","symbolLocation":412,"imageIndex":8},{"imageOffset":299212,"symbol":"__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.180","symbolLocation":100,"imageIndex":8},{"imageOffset":37104,"symbol":"-[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]","symbolLocation":232,"imageIndex":8},{"imageOffset":42232,"symbol":"__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke","symbolLocation":312,"imageIndex":8},{"imageOffset":410024,"symbol":"_dispatch_client_callout","symbolLocation":16,"imageIndex":7},{"imageOffset":27344,"symbol":"_dispatch_block_invoke_direct$VARIANT$mp","symbolLocation":220,"imageIndex":7},{"imageOffset":42960,"symbol":"__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__","symbolLocation":40,"imageIndex":8},{"imageOffset":40156,"symbol":"-[FBSSerialQueue _targetQueue_performNextIfPossible]","symbolLocation":176,"imageIndex":8},{"imageOffset":56900,"symbol":"-[FBSSerialQueue _performNextFromRunLoopSource]","symbolLocation":24,"imageIndex":8},{"imageOffset":729776,"symbol":"__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__","symbolLocation":24,"imageIndex":4},{"imageOffset":795352,"symbol":"__CFRunLoopDoSource0","symbolLocation":204,"imageIndex":4},{"imageOffset":22136,"symbol":"__CFRunLoopDoSources0","symbolLocation":256,"imageIndex":4},{"imageOffset":43688,"symbol":"__CFRunLoopRun","symbolLocation":768,"imageIndex":4},{"imageOffset":122396,"symbol":"CFRunLoopRunSpecific","symbolLocation":572,"imageIndex":4},{"imageOffset":6560,"symbol":"GSEventRunModal","symbolLocation":160,"imageIndex":9},{"imageOffset":5162496,"symbol":"-[UIApplication _run]","symbolLocation":1080,"imageIndex":10},{"imageOffset":2628360,"symbol":"UIApplicationMain","symbolLocation":2028,"imageIndex":10},{"imageOffset":6357064,"imageIndex":3},{"imageOffset":5659504,"imageIndex":3},{"imageOffset":735588,"imageIndex":3},{"imageOffset":4497056,"imageIndex":3},{"imageOffset":27583448,"imageIndex":3},{"imageOffset":28347188,"imageIndex":3},{"imageOffset":28372456,"imageIndex":3},{"imageOffset":27445224,"imageIndex":3},{"imageOffset":29268332,"imageIndex":3},{"imageOffset":735424,"imageIndex":3},{"imageOffset":98896,"symbol":"start","symbolLocation":444,"imageIndex":11}], "faultingThread" : 0, "threads" : [{"triggered":true,"id":7001002,"threadState":{"x":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":10000000},{"value":6656},{"value":0},{"value":4377052544,"symbolLocation":0,"symbol":"_main_thread"},{"value":9444832902787961409},{"value":1000},{"value":0},{"value":4374720048},{"value":4396135443},{"value":96},{"value":2147483648},{"value":328},{"value":35220},{"value":0},{"value":6},{"value":259},{"value":4377052768,"symbolLocation":224,"symbol":"_main_thread"},{"value":0},{"value":4387366400},{"value":4396135440},{"value":6127452192},{"value":1},{"value":4371711952},{"value":16777215}],"flavor":"ARM_THREAD_STATE64","lr":{"value":8063379492},"cpsr":{"value":1073741824},"fp":{"value":6127448544},"sp":{"value":6127448512},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":7524698600,"matchesCrashFrame":1},"far":{"value":0}},"name":"tid_103","queue":"com.apple.main-thread","frames":[{"imageOffset":27112,"symbol":"__pthread_kill","symbolLocation":8,"imageIndex":0},{"imageOffset":67620,"symbol":"pthread_kill","symbolLocation":208,"imageIndex":1},{"imageOffset":471172,"symbol":"__abort","symbolLocation":124,"imageIndex":2},{"imageOffset":127168,"symbol":"abort","symbolLocation":132,"imageIndex":2},{"imageOffset":29233400,"imageIndex":3},{"imageOffset":27948312,"imageIndex":3},{"imageOffset":27510416,"imageIndex":3},{"imageOffset":27504740,"imageIndex":3},{"imageOffset":27463136,"imageIndex":3},{"imageOffset":4929516,"imageIndex":3},{"imageOffset":28395608,"imageIndex":3},{"imageOffset":29232364,"imageIndex":3},{"imageOffset":27507688,"imageIndex":3},{"imageOffset":27504740,"imageIndex":3},{"imageOffset":27463136,"imageIndex":3},{"imageOffset":4929516,"imageIndex":3},{"imageOffset":5997920,"imageIndex":3},{"imageOffset":5980964,"imageIndex":3},{"imageOffset":6449104,"imageIndex":3},{"imageOffset":1096596,"symbol":"__handleUncaughtException","symbolLocation":628,"imageIndex":4},{"imageOffset":106508,"symbol":"_objc_terminate()","symbolLocation":112,"imageIndex":5},{"imageOffset":74444,"symbol":"std::__terminate(void (*)())","symbolLocation":16,"imageIndex":6},{"imageOffset":74356,"symbol":"std::terminate()","symbolLocation":60,"imageIndex":6},{"imageOffset":410044,"symbol":"_dispatch_client_callout","symbolLocation":36,"imageIndex":7},{"imageOffset":27344,"symbol":"_dispatch_block_invoke_direct$VARIANT$mp","symbolLocation":220,"imageIndex":7},{"imageOffset":42960,"symbol":"__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__","symbolLocation":40,"imageIndex":8},{"imageOffset":40156,"symbol":"-[FBSSerialQueue _targetQueue_performNextIfPossible]","symbolLocation":176,"imageIndex":8},{"imageOffset":56900,"symbol":"-[FBSSerialQueue _performNextFromRunLoopSource]","symbolLocation":24,"imageIndex":8},{"imageOffset":729776,"symbol":"__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__","symbolLocation":24,"imageIndex":4},{"imageOffset":795352,"symbol":"__CFRunLoopDoSource0","symbolLocation":204,"imageIndex":4},{"imageOffset":22136,"symbol":"__CFRunLoopDoSources0","symbolLocation":256,"imageIndex":4},{"imageOffset":43688,"symbol":"__CFRunLoopRun","symbolLocation":768,"imageIndex":4},{"imageOffset":122396,"symbol":"CFRunLoopRunSpecific","symbolLocation":572,"imageIndex":4},{"imageOffset":6560,"symbol":"GSEventRunModal","symbolLocation":160,"imageIndex":9},{"imageOffset":5162496,"symbol":"-[UIApplication _run]","symbolLocation":1080,"imageIndex":10},{"imageOffset":2628360,"symbol":"UIApplicationMain","symbolLocation":2028,"imageIndex":10},{"imageOffset":6357064,"imageIndex":3},{"imageOffset":5659504,"imageIndex":3},{"imageOffset":735588,"imageIndex":3},{"imageOffset":4497056,"imageIndex":3},{"imageOffset":27583448,"imageIndex":3},{"imageOffset":28347188,"imageIndex":3},{"imageOffset":28372456,"imageIndex":3},{"imageOffset":27445224,"imageIndex":3},{"imageOffset":29268332,"imageIndex":3},{"imageOffset":735424,"imageIndex":3},{"imageOffset":98896,"symbol":"start","symbolLocation":444,"imageIndex":11}]},{"id":7001006,"frames":[{"imageOffset":18920,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":7001037,"name":"SGen worker","frames":[{"imageOffset":5360,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":0},{"imageOffset":52220,"symbol":"_pthread_cond_wait$VARIANT$mp","symbolLocation":1216,"imageIndex":1},{"imageOffset":29015296,"imageIndex":3},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},{"imageOffset":18940,"symbol":"thread_start","symbolLocation":8,"imageIndex":1}]},{"id":7001043,"name":"Finalizer","frames":[{"imageOffset":2892,"symbol":"semaphore_wait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":27961632,"imageIndex":3},{"imageOffset":28665400,"imageIndex":3},{"imageOffset":28665020,"imageIndex":3},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},{"imageOffset":18940,"symbol":"thread_start","symbolLocation":8,"imageIndex":1}]},{"id":7001044,"frames":[{"imageOffset":18920,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":7001045,"frames":[{"imageOffset":18920,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":1}]},{"id":7001046,"name":"com.apple.uikit.eventfetch-thread","frames":[{"imageOffset":2832,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":4404,"symbol":"mach_msg","symbolLocation":72,"imageIndex":0},{"imageOffset":27488,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":368,"imageIndex":4},{"imageOffset":44104,"symbol":"__CFRunLoopRun","symbolLocation":1184,"imageIndex":4},{"imageOffset":122396,"symbol":"CFRunLoopRunSpecific","symbolLocation":572,"imageIndex":4},{"imageOffset":95180,"symbol":"-[NSRunLoop(NSRunLoop) runMode:beforeDate:]","symbolLocation":232,"imageIndex":12},{"imageOffset":351292,"symbol":"-[NSRunLoop(NSRunLoop) runUntilDate:]","symbolLocation":88,"imageIndex":12},{"imageOffset":4629320,"symbol":"-[UIEventFetcher threadMain]","symbolLocation":512,"imageIndex":10},{"imageOffset":407724,"symbol":"__NSThread__start__","symbolLocation":792,"imageIndex":12},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},{"imageOffset":18940,"symbol":"thread_start","symbolLocation":8,"imageIndex":1}]},{"id":7001047,"queue":"com.apple.UIKit.KeyboardManagement","frames":[{"imageOffset":5876,"symbol":"__ulock_wait","symbolLocation":8,"imageIndex":0},{"imageOffset":18172,"symbol":"_dlock_wait","symbolLocation":52,"imageIndex":7},{"imageOffset":17640,"symbol":"_dispatch_thread_event_wait_slow$VARIANT$mp","symbolLocation":52,"imageIndex":7},{"imageOffset":70800,"symbol":"__DISPATCH_WAIT_FOR_QUEUE__","symbolLocation":320,"imageIndex":7},{"imageOffset":69812,"symbol":"_dispatch_sync_f_slow","symbolLocation":136,"imageIndex":7},{"imageOffset":3490008,"symbol":"__37-[_UIRemoteKeyboards startConnection]_block_invoke_3","symbolLocation":112,"imageIndex":10},{"imageOffset":133488,"symbol":"__invoking___","symbolLocation":144,"imageIndex":4},{"imageOffset":247368,"symbol":"-[NSInvocation invoke]","symbolLocation":300,"imageIndex":4},{"imageOffset":206832,"symbol":"__NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__","symbolLocation":20,"imageIndex":12},{"imageOffset":335816,"symbol":"-[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:]","symbolLocation":568,"imageIndex":12},{"imageOffset":190012,"symbol":"__88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3","symbolLocation":208,"imageIndex":12},{"imageOffset":101576,"symbol":"_xpc_connection_reply_callout","symbolLocation":60,"imageIndex":13},{"imageOffset":53252,"symbol":"_xpc_connection_call_reply_async","symbolLocation":76,"imageIndex":13},{"imageOffset":410144,"symbol":"_dispatch_client_callout3","symbolLocation":16,"imageIndex":7},{"imageOffset":118880,"symbol":"_dispatch_mach_msg_async_reply_invoke$VARIANT$mp","symbolLocation":352,"imageIndex":7},{"imageOffset":40884,"symbol":"_dispatch_lane_serial_drain$VARIANT$mp","symbolLocation":340,"imageIndex":7},{"imageOffset":43972,"symbol":"_dispatch_lane_invoke$VARIANT$mp","symbolLocation":456,"imageIndex":7},{"imageOffset":83808,"symbol":"_dispatch_workloop_worker_thread","symbolLocation":632,"imageIndex":7},{"imageOffset":20100,"symbol":"_pthread_wqthread","symbolLocation":284,"imageIndex":1},{"imageOffset":18928,"symbol":"start_wqthread","symbolLocation":8,"imageIndex":1}]},{"id":7001049,"name":"tid_5703","frames":[{"imageOffset":5360,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":0},{"imageOffset":52220,"symbol":"_pthread_cond_wait$VARIANT$mp","symbolLocation":1216,"imageIndex":1},{"imageOffset":29078140,"imageIndex":3},{"imageOffset":29114340,"imageIndex":3},{"imageOffset":28616676,"imageIndex":3},{"imageOffset":28665400,"imageIndex":3},{"imageOffset":28665020,"imageIndex":3},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},{"imageOffset":18940,"symbol":"thread_start","symbolLocation":8,"imageIndex":1}]},{"id":7001050,"name":"Thread Pool Worker","frames":[{"imageOffset":2916,"symbol":"semaphore_timedwait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":28618908,"imageIndex":3},{"imageOffset":28665400,"imageIndex":3},{"imageOffset":28665020,"imageIndex":3},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},{"imageOffset":18940,"symbol":"thread_start","symbolLocation":8,"imageIndex":1}]},{"id":7001051,"name":"Thread Pool Worker","frames":[{"imageOffset":2916,"symbol":"semaphore_timedwait_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":28618908,"imageIndex":3},{"imageOffset":28665400,"imageIndex":3},{"imageOffset":28665020,"imageIndex":3},{"imageOffset":25508,"symbol":"_pthread_start","symbolLocation":116,"imageIndex":1},
I think you should always test your app on a physical device before submitting your app to the App store. By doing so you can correct bugs or missing permissions early.
'Function Not Exported' Error When Using The RabbitMQ Delayed Message Exchange Plugin
I am trying to get the rabbitmq-delayed-message-exchange plugin working on centos 7 but I am encountering the error 'function not exported' when I try to publish a delayed message. The error seems to be an erlang issue when it attempts to run erlang:system_time(milli_seconds). I don't know erlang at all but from what I can work out it looks as if the erlang module is either not imported or not installed. Any help would be great! :D Versions rabbitmq: 3.6.5 rabbitmq_delayed_message_exchange: 0.0.1 erlang: R16B03-1 RabbitMQ Log =ERROR REPORT==== 28-Sep-2016::15:51:59 === ** Generic server rabbit_delayed_message terminating ** Last message in was {delay_message, {exchange, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, 'x-delayed-message',true,false,false, [{<<"x-delayed-type">>,longstr,<<"direct">>}], undefined,undefined, {[],[]}}, {delivery,false,false,<0.4340.2>, {basic_message, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, [<<"papyrus.hopeline.staging.requeue">>], {content,60, {'P_basic',undefined,undefined, [{<<"x-delay">>,signedint,600000}], undefined,undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined,undefined, undefined}, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121,73,0,9, 39,192>>, rabbit_framing_amqp_0_9_1, [<<"{\"_id\":\"579f380d9f3a78d60cb2063d\",\"__v\":2,\"created\":\"2016-08-01T11:52:45.346Z\",\"client\":{\"_id\":\"579f380d9f3a78d60cb2063b\"},\"assignedTo\":[{\"_id\":\"57ebd50f9e4a04b45444a639\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:34:55.441Z\"},{\"_id\":\"57ebd52b9e4a04b45444a63b\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:35:23.292Z\"}],\"assigned\":false}">>]}, <<85,201,10,44,175,144,74,190,136,41,55,79,176,130, 253,85>>, false}, undefined,noflow}, 600000} ** When Server state == {state,not_set} ** Reason for termination == ** {'function not exported', [{erlang,system_time,[milli_seconds],[]}, {rabbit_delayed_message,internal_delay_message,4, [{file,"src/rabbit_delayed_message.erl"},{line,179}]}, {rabbit_delayed_message,handle_call,3, [{file,"src/rabbit_delayed_message.erl"},{line,122}]}, {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,585}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} =ERROR REPORT==== 28-Sep-2016::15:51:59 === ** Generic server <0.4340.2> terminating ** Last message in was {'$gen_cast', {method, {'basic.publish',0, <<"papyrus.hopeline.staging.requeue">>, <<"papyrus.hopeline.staging.requeue">>, false,false}, {content,60,none, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121, 73,0,9,39,192>>, rabbit_framing_amqp_0_9_1, [<<"{\"_id\":\"579f380d9f3a78d60cb2063d\",\"__v\":2,\"created\":\"2016-08-01T11:52:45.346Z\",\"client\":{\"_id\":\"579f380d9f3a78d60cb2063b\"},\"assignedTo\":[{\"_id\":\"57ebd50f9e4a04b45444a639\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:34:55.441Z\"},{\"_id\":\"57ebd52b9e4a04b45444a63b\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:35:23.292Z\"}],\"assigned\":false}">>]}, flow}} ** When Server state == {ch,running,rabbit_framing_amqp_0_9_1,2,<0.4153.2>, <0.4338.2>,<0.4153.2>, <<"172.30.0.13:41896 -> 172.30.0.11:5672">>, {lstate,<0.4339.2>,false}, none,1, {[],[]}, {user,<<"developers">>, [administrator], [{rabbit_auth_backend_internal,none}]}, <<"/">>,<<>>, {dict,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[]}}}, {state, {dict,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[], [],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[], [],[],[]}}}, erlang}, {dict,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[]}}}, {dict,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[]}}}, {set,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[], []}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[], [],[]}}}, <0.4154.2>, {state,fine,5000,#Ref<0.0.0.136584>}, false,1, {{0,nil},{0,nil}}, [], {{0,nil},{0,nil}}, [{<<"publisher_confirms">>,bool,true}, {<<"exchange_exchange_bindings">>,bool,true}, {<<"basic.nack">>,bool,true}, {<<"consumer_cancel_notify">>,bool,true}, {<<"connection.blocked">>,bool,true}, {<<"authentication_failure_close">>,bool,true}], none,0,none,flow,[]} ** Reason for termination == ** {{{undef, [{erlang,system_time,[milli_seconds],[]}, {rabbit_delayed_message,internal_delay_message,4, [{file,"src/rabbit_delayed_message.erl"},{line,179}]}, {rabbit_delayed_message,handle_call,3, [{file,"src/rabbit_delayed_message.erl"},{line,122}]}, {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,585}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}, {gen_server,call, [rabbit_delayed_message, {delay_message, {exchange, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, 'x-delayed-message',true,false,false, [{<<"x-delayed-type">>,longstr,<<"direct">>}], undefined,undefined, {[],[]}}, {delivery,false,false,<0.4340.2>, {basic_message, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, [<<"papyrus.hopeline.staging.requeue">>], {content,60, {'P_basic',undefined,undefined, [{<<"x-delay">>,signedint,600000}], undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined, undefined,undefined,undefined}, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121,73,0,9, 39,192>>, rabbit_framing_amqp_0_9_1, [<<"{\"_id\":\"579f380d9f3a78d60cb2063d\",\"__v\":2,\"created\":\"2016-08-01T11:52:45.346Z\",\"client\":{\"_id\":\"579f380d9f3a78d60cb2063b\"},\"assignedTo\":[{\"_id\":\"57ebd50f9e4a04b45444a639\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:34:55.441Z\"},{\"_id\":\"57ebd52b9e4a04b45444a63b\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:35:23.292Z\"}],\"assigned\":false}">>]}, <<85,201,10,44,175,144,74,190,136,41,55,79,176,130,253,85>>, false}, undefined,noflow}, 600000}, infinity]}}, [{gen_server,call,3,[{file,"gen_server.erl"},{line,188}]}, {rabbit_exchange_type_delayed_message,route,2, [{file,"src/rabbit_exchange_type_delayed_message.erl"},{line,53}]}, {rabbit_exchange,route1,3,[{file,"src/rabbit_exchange.erl"},{line,381}]}, {rabbit_exchange,route,2,[{file,"src/rabbit_exchange.erl"},{line,371}]}, {rabbit_channel,handle_method,3, [{file,"src/rabbit_channel.erl"},{line,943}]}, {rabbit_channel,handle_cast,2, [{file,"src/rabbit_channel.erl"},{line,457}]}, {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1032}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} =ERROR REPORT==== 28-Sep-2016::15:51:59 === Error on AMQP connection <0.4153.2> (172.30.0.13:41896 -> 172.30.0.11:5672, vhost: '/', user: 'developers', state: running), channel 2: {{{undef, [{erlang,system_time,[milli_seconds],[]}, {rabbit_delayed_message,internal_delay_message,4, [{file,"src/rabbit_delayed_message.erl"},{line,179}]}, {rabbit_delayed_message,handle_call,3, [{file,"src/rabbit_delayed_message.erl"},{line,122}]}, {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,585}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}, {gen_server,call, [rabbit_delayed_message, {delay_message, {exchange, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, 'x-delayed-message',true,false,false, [{<<"x-delayed-type">>,longstr,<<"direct">>}], undefined,undefined, {[],[]}}, {delivery,false,false,<0.4340.2>, {basic_message, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, [<<"papyrus.hopeline.staging.requeue">>], {content,60, {'P_basic',undefined,undefined, [{<<"x-delay">>,signedint,600000}], undefined,undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined,undefined, undefined}, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121,73,0,9,39, 192>>, rabbit_framing_amqp_0_9_1, [<<"{\"_id\":\"579f380d9f3a78d60cb2063d\",\"__v\":2,\"created\":\"2016-08-01T11:52:45.346Z\",\"client\":{\"_id\":\"579f380d9f3a78d60cb2063b\"},\"assignedTo\":[{\"_id\":\"57ebd50f9e4a04b45444a639\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:34:55.441Z\"},{\"_id\":\"57ebd52b9e4a04b45444a63b\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:35:23.292Z\"}],\"assigned\":false}">>]}, <<85,201,10,44,175,144,74,190,136,41,55,79,176,130,253,85>>, false}, undefined,noflow}, 600000}, infinity]}}, [{gen_server,call,3,[{file,"gen_server.erl"},{line,188}]}, {rabbit_exchange_type_delayed_message,route,2, [{file,"src/rabbit_exchange_type_delayed_message.erl"},{line,53}]}, {rabbit_exchange,route1,3,[{file,"src/rabbit_exchange.erl"},{line,381}]}, {rabbit_exchange,route,2,[{file,"src/rabbit_exchange.erl"},{line,371}]}, {rabbit_channel,handle_method,3, [{file,"src/rabbit_channel.erl"},{line,943}]}, {rabbit_channel,handle_cast,2,[{file,"src/rabbit_channel.erl"},{line,457}]}, {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1032}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]} =WARNING REPORT==== 28-Sep-2016::15:51:59 === Non-AMQP exit reason '{{{undef, [{erlang,system_time,[milli_seconds],[]}, {rabbit_delayed_message,internal_delay_message,4, [{file,"src/rabbit_delayed_message.erl"}, {line,179}]}, {rabbit_delayed_message,handle_call,3, [{file,"src/rabbit_delayed_message.erl"}, {line,122}]}, {gen_server,handle_msg,5, [{file,"gen_server.erl"},{line,585}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,239}]}]}, {gen_server,call, [rabbit_delayed_message, {delay_message, {exchange, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, 'x-delayed-message',true,false,false, [{<<"x-delayed-type">>,longstr,<<"direct">>}], undefined,undefined, {[],[]}}, {delivery,false,false,<0.4340.2>, {basic_message, {resource,<<"/">>,exchange, <<"papyrus.hopeline.staging.requeue">>}, [<<"papyrus.hopeline.staging.requeue">>], {content,60, {'P_basic',undefined,undefined, [{<<"x-delay">>,signedint,600000}], undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined, undefined,undefined,undefined}, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121,73,0, 9,39,192>>, rabbit_framing_amqp_0_9_1, [<<"{\"_id\":\"579f380d9f3a78d60cb2063d\",\"__v\":2,\"created\":\"2016-08-01T11:52:45.346Z\",\"client\":{\"_id\":\"579f380d9f3a78d60cb2063b\"},\"assignedTo\":[{\"_id\":\"57ebd50f9e4a04b45444a639\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:34:55.441Z\"},{\"_id\":\"57ebd52b9e4a04b45444a63b\",\"user\":{\"_id\":\"571e37f0cbd7a8ae2b73e925\",\"name\":\"Jason Royle\"},\"created\":\"2016-09-28T14:35:23.292Z\"}],\"assigned\":false}">>]}, <<85,201,10,44,175,144,74,190,136,41,55,79,176, 130,253,85>>, false}, undefined,noflow}, 600000}, infinity]}}, [{gen_server,call,3, [{file,"gen_server.erl"},{line,188}]}, {rabbit_exchange_type_delayed_message,route,2, [{file, "src/rabbit_exchange_type_delayed_message.erl"}, {line,53}]}, {rabbit_exchange,route1,3, [{file,"src/rabbit_exchange.erl"},{line,381}]}, {rabbit_exchange,route,2, [{file,"src/rabbit_exchange.erl"},{line,371}]}, {rabbit_channel,handle_method,3, [{file,"src/rabbit_channel.erl"},{line,943}]}, {rabbit_channel,handle_cast,2, [{file,"src/rabbit_channel.erl"},{line,457}]}, {gen_server2,handle_msg,2, [{file,"src/gen_server2.erl"},{line,1032}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,239}]}]}'
The solution to this was to upgrade the version of erlang as the system_time function of the erlang module only exists as of version 18. To install the latest version on centos I used this rpm package to upgrade to version 19.1.
"Flush Result : No Connectivity" Error for FBSDKAppEvents
I have integrated FBSDKCoreKit.framework to track app events, I am calling [FBSDKAppEvents activateApp] in applicationDidBecomeActive: and enabling logs using [FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorAppEvents] In logs it's logging following error FBSDKLog: FBSDKAppEvents: Flushed # 1473666575, 2 events due to 'Timer' - { "advertiser_tracking_enabled" = 1; "anon_id" = "xxxxxx-xxxxx-xxxxx-xxxxx"; "application_tracking_enabled" = 1; event = "CUSTOM_APP_EVENTS"; extinfo = "[xxx, xxx, xxx]"; "url_schemes" = "[\"xxxxxxxx\"]"; } Events: [ { "isImplicit" : false, "event" : { "fb_mobile_launch_source" : "Unclassified", "_session_id" : "xxxxxx-xxxxx-xxxxx-xxxxx", "fb_mobile_app_interruptions" : 0, "_logTime" : 1473664599, "_ui" : "no_ui", "_eventName" : "fb_mobile_deactivate_app", "_valueToSum" : 155, "fb_mobile_time_between_sessions" : "session_quanta_2" } }, { "isImplicit" : false, "event" : { "fb_mobile_launch_source" : "Unclassified", "_ui" : "no_ui", "_eventName" : "fb_mobile_activate_app", "_logTime" : 1473665765, "_session_id" : "96FA9509-AB21-475F-9F44-3005FE5D10BC" } } ] Flush Result : No Connectivity At end of log it's showing me error Flush Result : No Connectivity Any one know why I'm getting this error ?
I got it working by following this guide FBSDK doc here does not explain about each configuration required for tracking events
how to download video using URLSession, save and play it in appcelerator titanium?
I am trying to download and save a video using URLSession and then play it in video player. But somehow it's not playing, rather it's crashing the app. Here's the code for it.I have tried almost everything to read the exact path of file using nativePath , getNativePath(), file.resolve(), but nothing seems to work. Take a look at the code and suggest a solution. This is for iOS. (iOS Version 8.4) UPDATED CODE : var args = arguments[0] || {}; var vidWin = $.winTestVideo; var isDownloading = false; var urlSession = require("com.appcelerator.urlSession"); var downloadSession; var urlArray = ["http://www.kaltura.com/p/{PARTNERID}/sp/{SUBPARTNERID}/playManifest/entryId/{entryId}/format/applhttp/protocol/http/flavorId/{flavorId}/video.mp4", "http://www.kaltura.com/p/{PARTNERID}/sp/{SUBPARTNERID}/playManifest/entryId/{entryId}/format/applhttp/protocol/http/flavorId/{flavorId}/video.mp4"]; var urlArrIndex = 0; var progress; var videoPlayer; var imageUrl = 'http://dreamatico.com/data_images/rose/rose-4.jpg'; //'http://cdn.playbuzz.com/cdn/5d41f0c6-2688-47fe-85cf-82890ef6d91d/45611be8-42f9-4d02-9b63-f7195c0dc18c_560_420.jpg'; var img; function onLoad() { Alloy.Globals.CurrentWindowName = 'testvideoplayer'; var triggerBtn = Ti.UI.createButton({ top : 10, width : Ti.UI.FILL, height : 40, backgroundColor : "#cccccc", color : "#000000", title : "Download Videos" }); vidWin.add(triggerBtn); triggerBtn.addEventListener('click', downloadVideoBackround2); progress = Titanium.UI.createProgressBar({ width : 200, height : 20, min : 0, max : 1, value : 0, top : 60, backgroundColor : "#0000ff", style : Ti.UI.iPhone.ProgressBarStyle.BAR, }); vidWin.add(progress); img = Ti.UI.createImageView({ width : 100, height : 100, backgroundColor : "#cccccc" }); //vidWin.add(img); //videoPlayer.play(); } function createVideoPlayer() { videoPlayer = Ti.Media.createVideoPlayer({ width : Ti.UI.FILL, height : 240, top : 100, mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT, scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT, backgroundColor : "#000000", }); vidWin.add(videoPlayer); videoPlayer.removeEventListener('playbackstate', playbackStateEventListener); videoPlayer.addEventListener('playbackstate', playbackStateEventListener); } // Require in the urlSession module var urlSession = require("com.appcelerator.urlSession"); var session; // App UI function playbackStateEventListener(evt) { Ti.API.error("PlaybackStateEventListener : " + JSON.stringify(evt)); } function downloadVideoBackround2(evt){ // Create a session configuration // The string parameter is an arbitrary string used to identify the session in events var sessionConfig = urlSession.createURLSessionBackgroundConfiguration("com.appcelerator.test"); // Create a session session = urlSession.createURLSession(sessionConfig); // Create a background download task to get the asset with the URL urlSession.backgroundDownloadTaskWithURL(session,urlArray[0].replace('applhttp','url')); progress.show(); } // Monitor this event to receive updates on the progress of the download Ti.App.iOS.addEventListener("downloadprogress", function(e) { // Update the progress indicator Ti.API.error("DOWNLOAD PROGRESS : " + e.totalBytesWritten + "/" + e.totalBytesExpectedToWrite); progress.value = (e.totalBytesWritten / e.totalBytesExpectedToWrite); }); // Monitor this event to know when the download completes Ti.App.iOS.addEventListener("downloadcompleted", function(e) { Ti.API.error("download completed " + JSON.stringify(e)); // Update the image try { var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'myplvideo.mp4'); if (!file.exists()) { file.createFile(); } file.write(e.data); Ti.API.error('data : ' + e.data.length); Ti.API.error('file : ' + file.nativePath); Ti.API.error('file resolve path :' + file.resolve()); progress.hide(); // Notify the user the download is complete if the application is in the background setTimeout(function() { //videoPlayer.media = file; createVideoPlayer(); videoPlayer.media = file; urlSession.finishTasksAndInvalidate(session); //videoPlayer.play(); }, 3000); //alert('Download completed!'); /* Ti.App.iOS.scheduleLocalNotification({ alertAction : "update", // Alert will display the following message alertBody : "Download was successfull", // The badge value in the icon will be changed to 1 badge : 1, // Alert will be sent in three seconds date : new Date(new Date().getTime() + 3000), });*/ } catch(ex) { Ti.API.error('download completed : ' + ex); } }); // Monitor this event to know when all session tasks have completed Ti.App.iOS.addEventListener('sessioncompleted', function(e) { try { Ti.API.error("sessioncompleted " + JSON.stringify(e)); if (e.success) { //alert("Downloads completed successfully."); } } catch(ex) { Ti.API.error('Exception session completed : ' + ex); } }); The app is crashing when i assign the file to videoPlayer's media property. But when i download the file using HttpClient, it works fine. Not really sure why it's happening as i can't see any error in the logs. Here are the logs. I have used the [Error] for highlighting the important logging. [ERROR] : DOWNLOAD PROGRESS : 67470/5794757 [ERROR] : DOWNLOAD PROGRESS : 133006/5794757 [ERROR] : DOWNLOAD PROGRESS : 199614/5794757 [ERROR] : DOWNLOAD PROGRESS : 266222/5794757 [ERROR] : DOWNLOAD PROGRESS : 275982/5794757 [ERROR] : DOWNLOAD PROGRESS : 341518/5794757 [ERROR] : DOWNLOAD PROGRESS : 408126/5794757 [ERROR] : DOWNLOAD PROGRESS : 474734/5794757 [ERROR] : DOWNLOAD PROGRESS : 541342/5794757 [ERROR] : DOWNLOAD PROGRESS : 609398/5794757 [ERROR] : DOWNLOAD PROGRESS : 677454/5794757 [ERROR] : DOWNLOAD PROGRESS : 745510/5794757 [ERROR] : DOWNLOAD PROGRESS : 758166/5794757 [ERROR] : DOWNLOAD PROGRESS : 823702/5794757 [ERROR] : DOWNLOAD PROGRESS : 897550/5794757 [ERROR] : DOWNLOAD PROGRESS : 1048142/5794757 [ERROR] : DOWNLOAD PROGRESS : 1114750/5794757 [ERROR] : DOWNLOAD PROGRESS : 1182806/5794757 [ERROR] : DOWNLOAD PROGRESS : 1249414/5794757 [ERROR] : DOWNLOAD PROGRESS : 1316022/5794757 [ERROR] : DOWNLOAD PROGRESS : 1382630/5794757 [ERROR] : DOWNLOAD PROGRESS : 1385150/5794757 [ERROR] : DOWNLOAD PROGRESS : 1450686/5794757 [ERROR] : DOWNLOAD PROGRESS : 1518742/5794757 [ERROR] : DOWNLOAD PROGRESS : 1586798/5794757 [ERROR] : DOWNLOAD PROGRESS : 1653406/5794757 [ERROR] : DOWNLOAD PROGRESS : 1720014/5794757 [ERROR] : DOWNLOAD PROGRESS : 1786622/5794757 [ERROR] : DOWNLOAD PROGRESS : 1854678/5794757 [ERROR] : DOWNLOAD PROGRESS : 1921286/5794757 [ERROR] : DOWNLOAD PROGRESS : 1989342/5794757 [ERROR] : DOWNLOAD PROGRESS : 2057398/5794757 [ERROR] : DOWNLOAD PROGRESS : 2059918/5794757 [ERROR] : DOWNLOAD PROGRESS : 2125454/5794757 [ERROR] : DOWNLOAD PROGRESS : 2205094/5794757 [ERROR] : DOWNLOAD PROGRESS : 2271702/5794757 [ERROR] : DOWNLOAD PROGRESS : 2341206/5794757 [ERROR] : DOWNLOAD PROGRESS : 2342278/5794757 [ERROR] : DOWNLOAD PROGRESS : 2407814/5794757 [ERROR] : DOWNLOAD PROGRESS : 2410334/5794757 [ERROR] : DOWNLOAD PROGRESS : 2475870/5794757 [ERROR] : DOWNLOAD PROGRESS : 2542478/5794757 [ERROR] : DOWNLOAD PROGRESS : 2609086/5794757 [ERROR] : DOWNLOAD PROGRESS : 2675694/5794757 [ERROR] : DOWNLOAD PROGRESS : 2676766/5794757 [ERROR] : DOWNLOAD PROGRESS : 2742302/5794757 [ERROR] : DOWNLOAD PROGRESS : 2808910/5794757 [ERROR] : DOWNLOAD PROGRESS : 2876966/5794757 [ERROR] : DOWNLOAD PROGRESS : 2943574/5794757 [ERROR] : DOWNLOAD PROGRESS : 3010182/5794757 [ERROR] : DOWNLOAD PROGRESS : 3076790/5794757 [ERROR] : DOWNLOAD PROGRESS : 3143398/5794757 [ERROR] : DOWNLOAD PROGRESS : 3212902/5794757 [ERROR] : DOWNLOAD PROGRESS : 3274790/5794757 [ERROR] : DOWNLOAD PROGRESS : 3340326/5794757 [ERROR] : DOWNLOAD PROGRESS : 3422862/5794757 [ERROR] : DOWNLOAD PROGRESS : 3557526/5794757 [ERROR] : DOWNLOAD PROGRESS : 3624134/5794757 [ERROR] : DOWNLOAD PROGRESS : 3692190/5794757 [ERROR] : DOWNLOAD PROGRESS : 3758798/5794757 [ERROR] : DOWNLOAD PROGRESS : 3825406/5794757 [ERROR] : DOWNLOAD PROGRESS : 3893462/5794757 [ERROR] : DOWNLOAD PROGRESS : 3960070/5794757 [ERROR] : DOWNLOAD PROGRESS : 4026678/5794757 [ERROR] : DOWNLOAD PROGRESS : 4094734/5794757 [ERROR] : DOWNLOAD PROGRESS : 4161342/5794757 [ERROR] : DOWNLOAD PROGRESS : 4227950/5794757 [ERROR] : DOWNLOAD PROGRESS : 4294558/5794757 [ERROR] : DOWNLOAD PROGRESS : 4362614/5794757 [ERROR] : DOWNLOAD PROGRESS : 4430670/5794757 [ERROR] : DOWNLOAD PROGRESS : 4497278/5794757 [ERROR] : DOWNLOAD PROGRESS : 4498350/5794757 [ERROR] : DOWNLOAD PROGRESS : 4563886/5794757 [ERROR] : DOWNLOAD PROGRESS : 4630494/5794757 [ERROR] : DOWNLOAD PROGRESS : 4697102/5794757 [ERROR] : DOWNLOAD PROGRESS : 4699622/5794757 [ERROR] : DOWNLOAD PROGRESS : 4765158/5794757 [ERROR] : DOWNLOAD PROGRESS : 4831766/5794757 [ERROR] : DOWNLOAD PROGRESS : 4898374/5794757 [ERROR] : DOWNLOAD PROGRESS : 4964982/5794757 [ERROR] : DOWNLOAD PROGRESS : 5031590/5794757 [ERROR] : DOWNLOAD PROGRESS : 5098198/5794757 [ERROR] : DOWNLOAD PROGRESS : 5106510/5794757 [ERROR] : DOWNLOAD PROGRESS : 5172046/5794757 [ERROR] : DOWNLOAD PROGRESS : 5319742/5794757 [ERROR] : DOWNLOAD PROGRESS : 5320814/5794757 [ERROR] : DOWNLOAD PROGRESS : 5386350/5794757 [ERROR] : DOWNLOAD PROGRESS : 5455854/5794757 [ERROR] : DOWNLOAD PROGRESS : 5523910/5794757 [ERROR] : DOWNLOAD PROGRESS : 5591966/5794757 [ERROR] : DOWNLOAD PROGRESS : 5658574/5794757 [ERROR] : DOWNLOAD PROGRESS : 5726630/5794757 [ERROR] : DOWNLOAD PROGRESS : 5794686/5794757 [ERROR] : DOWNLOAD PROGRESS : 5794757/5794757 [ERROR] : download completed {"taskIdentifier":1,"data":{},"bubbles":true,"type":"downloadcompleted","source":{},"cancelBubble":false} [ERROR] : open on /var/mobile/Containers/Data/Application/9FBAAEB4-4878-4611-8BCC-EFC112AF9777/Documents/myplvideo.mp4: File exists [ERROR] : data : 5794757 [ERROR] : file : file:///var/mobile/Containers/Data/Application/9FBAAEB4-4878-4611-8BCC-EFC112AF9777/Documents/myplvideo.mp4 [ERROR] : file resolve path :/var/mobile/Containers/Data/Application/9FBAAEB4-4878-4611-8BCC-EFC112AF9777/Documents/myplvideo.mp4 [ERROR] : sessioncompleted {"success":true,"message":"","errorCode":0,"taskIdentifier":1,"bubbles":true,"type":"sessioncompleted","source":{},"cancelBubble":false}
My quick guess would be that you have a race condition. Inside of your setTimeout you never actually check to see if the file has been written, like you do when you have finished downloading, assuming at this point that 3s is long enough. // Notify the user the download is complete if the application is in the background setTimeout(function() { //videoPlayer.media = file; createVideoPlayer(); videoPlayer.media = file; urlSession.finishTasksAndInvalidate(session); //videoPlayer.play(); }, 3000); Additionally, the xcode logs for the device or simulator should be telling you where/what crashed (these may not always appear in the titanium logs)