ScenarioManager needs a Read-Only mode
The ScenarioManager needs to check write permissions and switch to a read-only mode if it cannot write. This is important for installed packages and needs to be done before the next release (which we want to do next week), so would be great until Tuesday evening.
You can test this for some custom testpackage by calling
sudo make install
mv ../build build_old
export PATH=$PATH:$HOME/install```
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Developer
@mirkowaechter what is your main concern here ? should the detailedApplication be not editable if the file is not writeable ? and maybe the new scenario button should be Gray as well i guess ? otherwise i encountered no problems.
also i am currently ill and can only work from home but i guess tomorrow evening is doable.
Edited by Cedric Seehausen - Author Maintainer
@cseehausen If you open a scenario from a read-only package you get a "Permission denied" error as soon as you open detailedApplication of an app. And yes, to make it visible to the user the detailedApplication should be not editable.
- Author Maintainer
Also it should not be possible to add a scenario to a read only package or add new applications to a read-only scenario.
Edited by Mirko Wächter - Cedric Seehausen mentioned in merge request !38 (merged)
mentioned in merge request !38 (merged)
- Developer
So the new Package dialog now checks if the Scenario folder of each Package is writable before showing it. Also if an config is not writable the DetailedView now is disabled (not editable). future work maybe add some kind of hint why it is disabled.
Also the error messages should be gone now. also if you update the writing permissions and reload the detailedView / want to create an scenario it should be updated.
Edited by Cedric Seehausen - Developer
also i was only able to test this at home and the jenkins build feature only would works if there would be no changes to the core as well. So you might want to have a look at it. Sry
- Author Maintainer
@cseehausen after merging I realized that the check does not work. You are checking if the owner can write. The owner can usually write. But it needs to be checked if the current user can write. I pushed a working version to the master, though there does not seem to exist a portable way to check if a directory can be written.
But the GUI does not consider the status at atleast one point and throws this exception. I updated the description in the issue how to exactly get a setup to test this.
Exception caught: boost::filesystem::remove: Permission denied: "/home/waechter/install/share/cmake/tp5/../../..//share/tp5/scenarios/tp5test/config/XMLRemoteStateOfferer.cfg" Backtrace: 1 0x7f021d27de49 armarx::LogSender::log(armarx::MessageType, std::string) + 2745 2 0x7f021d27e29b armarx::LogSender::flush() + 139 3 0x7f021d27e5d0 armarx::LogSender::~LogSender() + 512 4 0x7f021d27a5a2 boost::detail::sp_counted_impl_p<armarx::LogSender>::dispose() + 18 5 0x7f021d23e90e boost::detail::sp_counted_base::release() + 46 6 0x7f021cf2c32e armarx::ArmarXQApplication::notify(QObject*, QEvent*) + 446 7 0x7f0219bcc4dd QCoreApplication::notifyInternal(QObject*, QEvent*) + 109 8 0x7f0219bfc323 /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1ad323) [0x7f0219bfc323] 9 0x7f0219bf95f1 /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1aa5f1) [0x7f0219bf95f1] 10 0x7f0217780e04 g_main_context_dispatch + 596 11 0x7f0217781048 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49048) [0x7f0217781048] 12 0x7f02177810ec g_main_context_iteration + 44 13 0x7f0219bf97a1 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 113 14 0x7f021a19fbe6 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bbe6) [0x7f021a19fbe6] 15 0x7f0219bcb0af QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 47 16 0x7f0219bcb3a5 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 373 17 0x7f0219bd0b79 QCoreApplication::exec() + 137 18 0x7f021cf2bac6 armarx::ArmarXGuiApp::exec(IceUtil::Handle<armarx::ArmarXManager> const&) + 1862 19 0x7f021d2c11b2 armarx::Application::run(int, char**) + 2642 20 0x7f021cf2b2ee armarx::ArmarXGuiApp::run(int, char**) + 270 21 0x7f021e97cb7d Ice::Application::doMain(int, char**, Ice::InitializationData const&) + 381 22 0x7f021d2c2575 armarx::Application::doMain(int, char**, Ice::InitializationData const&) + 453 23 0x7f021e96b56b Ice::Application::main(int, char**, Ice::InitializationData const&) + 795 24 0x4063d6 main + 230 25 0x7f021bff8f45 __libc_start_main + 245 26 0x40716e /home/waechter/armarx/ArmarXGui/build/bin/ArmarXGuiRun() [0x40716e]
Edited by Mirko Wächter - Developer
@mirkowaechter The described error message should be fixed by my new commit, Gitlab seems to be a bit laggy noticing it though see here @0f9ee100
- Author Maintainer
The exception popup is gone but it still produces an error in the log, so it is still trying to write, when opening the detailedApplication view.
The exception is:
Failed to write to Cfg file at /home/waechter/install/share/cmake/tp5/../../..//share/tp5/scenarios/tp5test/config/XMLRemoteStateOfferer.cfg Backtrace: 1 0x7ff081918e49 armarx::LogSender::log(armarx::MessageType, std::string) + 2745 2 0x7ff08191929b armarx::LogSender::flush() + 139 3 0x7ff0819195d0 armarx::LogSender::~LogSender() + 512 4 0x7ff0819155a2 boost::detail::sp_counted_impl_p<armarx::LogSender>::dispose() + 18 5 0x7ff0818d990e boost::detail::sp_counted_base::release() + 46 6 0x7ff019fe659d ScenarioManager::Parser::IceParser::saveCfg(boost::weak_ptr<ScenarioManager::Data_Structure::ApplicationInstance>) + 1629 7 0x7ff019fddab4 ScenarioManager::Data_Structure::ApplicationInstance::save() + 148 8 0x7ff019feda5d ScenarioManager::Parser::XMLScenarioParser::saveScenario(boost::weak_ptr<ScenarioManager::Data_Structure::Scenario>) + 1421 9 0x7ff019fe4d6e ScenarioManager::Data_Structure::Scenario::save() + 126 10 0x7ff03014e286 ScenarioManager::Controller::ScenarioListController::saveScenario(boost::shared_ptr<ScenarioManager::Data_Structure::ApplicationInstance>) + 1494 11 0x7ff03015a2e3 /home/waechter/armarx/ArmarXGui/build/lib/libScenarioManagerGuiPlugin.so.0.8.8(+0x852e3) [0x7ff03015a2e3] 12 0x7ff07e27b87a QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 730 13 0x7ff03015a8e5 DetailedApplicationView::saveScenario(boost::shared_ptr<ScenarioManager::Data_Structure::ApplicationInstance>) + 37 14 0x7ff03012c170 DetailedApplicationView::on_fileUpdate() + 64 15 0x7ff03015aa8d /home/waechter/armarx/ArmarXGui/build/lib/libScenarioManagerGuiPlugin.so.0.8.8(+0x85a8d) [0x7ff03015aa8d] 16 0x7ff07e27b87a QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 730 17 0x7ff07e27fa31 QObject::event(QEvent*) + 97 18 0x7ff07e798e2c QApplicationPrivate::notify_helper(QObject*, QEvent*) + 140 19 0x7ff07e79f4a0 QApplication::notify(QObject*, QEvent*) + 624 20 0x7ff0815c7184 armarx::ArmarXQApplication::notify(QObject*, QEvent*) + 20 21 0x7ff07e2674dd QCoreApplication::notifyInternal(QObject*, QEvent*) + 109 22 0x7ff07e297323 /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1ad323) [0x7ff07e297323] 23 0x7ff07e2945f1 /usr/lib/x86_64-linux-gnu/libQtCore.so.4(+0x1aa5f1) [0x7ff07e2945f1] 24 0x7ff07be1be04 g_main_context_dispatch + 596 25 0x7ff07be1c048 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x49048) [0x7ff07be1c048] 26 0x7ff07be1c0ec g_main_context_iteration + 44 27 0x7ff07e2947a1 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 113 28 0x7ff07e83abe6 /usr/lib/x86_64-linux-gnu/libQtGui.so.4(+0x26bbe6) [0x7ff07e83abe6] 29 0x7ff07e2660af QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 47 30 0x7ff07e2663a5 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 373 31 0x7ff07e26bb79 QCoreApplication::exec() + 137 32 0x7ff0815c6ac6 armarx::ArmarXGuiApp::exec(IceUtil::Handle<armarx::ArmarXManager> const&) + 1862 33 0x7ff08195c1b2 armarx::Application::run(int, char**) + 2642 34 0x7ff0815c62ee armarx::ArmarXGuiApp::run(int, char**) + 270 35 0x7ff083017b7d Ice::Application::doMain(int, char**, Ice::InitializationData const&) + 381 36 0x7ff08195d575 armarx::Application::doMain(int, char**, Ice::InitializationData const&) + 453 37 0x7ff08300656b Ice::Application::main(int, char**, Ice::InitializationData const&) + 795 38 0x4063d6 main + 230 39 0x7ff080693f45 __libc_start_main + 245 40 0x40716e /home/waechter/armarx/ArmarXGui/build/bin/ArmarXGuiRun() [0x40716e]
- Developer
so i fixed it on both ends now. the gui should not try to save anymore + the core itself now prevents writing in its save functions.
Sorry for the inconvenience. I only have little time to test this.
- Author Maintainer
That works now, thanks. Another thing I just found: You can add new applications to a read-only scenario.
- Mirko Wächter added ~978380 label
added ~978380 label
- Author Maintainer
I fixed that now
- Mirko Wächter closed via merge request !38 (merged)
closed via merge request !38 (merged)
- Mirko Wächter mentioned in commit e37baef1
mentioned in commit e37baef1