Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

unable to roslaunch anything anymore #2

Closed
jwhendy opened this issue Nov 21, 2019 · 6 comments · Fixed by ros-melodic-arch/ros-melodic-rosgraph#1
Closed

unable to roslaunch anything anymore #2

jwhendy opened this issue Nov 21, 2019 · 6 comments · Fixed by ros-melodic-arch/ros-melodic-rosgraph#1

Comments

@jwhendy
Copy link
Contributor

jwhendy commented Nov 21, 2019

This morning I went to actually use ROS to get this error:

$ roslaunch turtle_tf turtle_tf_demo.launch 
... logging to /home/jwhendy/.ros/log/051227fc-0c27-11ea-a276-0024d6f9ae16/roslaunch-voltaur-2726355.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/__init__.py", line 322, in main
    p.start()
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/parent.py", line 273, in start
    self.logger.info("starting roslaunch parent run")
  File "/usr/lib/python3.8/logging/__init__.py", line 1434, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1565, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given

I suspected it was some buried lib depend on python3.8 somewhere, so I spent a good part of my day and evening rebuilding absolutely every ros-melodic-* package from scratch. I still get the error. Can anyone replicate this? I'm using turtle_tf as a reproducible example, but the failure happened on one of my work projects.

@jwhendy
Copy link
Contributor Author

jwhendy commented Nov 21, 2019

Ok, looks like this was actually upstream. That said, I tried using the patched branch and rebuilding/reinstalling ros-melodic-rosgraph, but I get a new error:

$ roslaunch turtle_tf turtle_tf_demo.launch 
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/roslaunch", line 34, in <module>
    import roslaunch
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/__init__.py", line 51, in <module>
    from . import core as roslaunch_core
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/core.py", line 233, in <module>
    get_master_uri_env   = rle_wrapper(rosgraph.get_master_uri) 
AttributeError: module 'rosgraph' has no attribute 'get_master_uri'

I'm wondering if ros_comm git upstream is farther ahead of our release and thus it's now complicated to try and apply a source-based patch to the rest of ros_comm which is on the release version? Unsure, and it's late and I want to be done with ROS for a while!

@Darnor
Copy link

Darnor commented Nov 21, 2019

Hey I'm the one who created the PR upstream. Looks like this package is based on version 1.14.3 (https://github.com/ros/ros_comm/tree/1.14.3) which is over a year old.

I only patched and tested it locally (on Arch with this package installed) and then made the PR, but it looks like more changes are needed. For now you could probably try to just apply the patch on install to this version and then try to get things working with the devel upstream later.

Here's the diff for 1.14.3:

diff --git a/tools/rosgraph/src/rosgraph/roslogging.py b/tools/rosgraph/src/rosgraph/roslogging.py
index 4986e81cb..5c998d9af 100644
--- a/tools/rosgraph/src/rosgraph/roslogging.py
+++ b/tools/rosgraph/src/rosgraph/roslogging.py
@@ -49,12 +49,12 @@ from rospkg.environment import ROS_LOG_DIR
 class LoggingException(Exception): pass
 
 class RospyLogger(logging.getLoggerClass()):
-    def findCaller(self, dummy=False): # Dummy second arg to match Python3 function declaration
+    def findCaller(self, *args, **kwargs):
         """
         Find the stack frame of the caller so that we can note the source
         file name, line number, and function name with class name if possible.
         """
-        file_name, lineno, func_name = super(RospyLogger, self).findCaller()[:3]
+        file_name, lineno, func_name = super(RospyLogger, self).findCaller(*args, **kwargs)[:3]
 
         f = inspect.currentframe()
         if f is not None:

@jwhendy
Copy link
Contributor Author

jwhendy commented Nov 21, 2019

Really, really appreciate this. I'll take a look later.

Just wanted to comment on the version: I'm not even sure why we're on 1.14.3. We use the versions for ROS Melodic, and ros_comm doesn't even have a release for it, and is listed as 1.12.2 for kinetic on rosindex. We try to follow what ROS lists as the most recent, distro-specific version, though you can certainly see how that's super inconvenient when we get a patch upstream that might not make it into a release for a year!

Edit: well ros_comm does have a melodic-devel; rosindex just doesn't seem to know about it?

We often end up patching until upstream catches up. Thanks again!!

@jwhendy
Copy link
Contributor Author

jwhendy commented Nov 21, 2019

@Darnor any suggestions on tracking this down?

$ roscore
Traceback (most recent call last):
  File "/opt/ros/melodic/bin/roscore", line 72, in <module>
    import roslaunch
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/__init__.py", line 51, in <module>
    from . import core as roslaunch_core
  File "/opt/ros/melodic/lib/python3.8/site-packages/roslaunch/core.py", line 233, in <module>
    get_master_uri_env   = rle_wrapper(rosgraph.get_master_uri)
AttributeError: module 'rosgraph' has no attribute 'get_master_uri'

Edit: missed a line, and this is with your patch applied. I get the same error (above) using your fork/patched branch as I do with this 1.14.3 patch...

It seems like roslaunch is assuming something exists in rosgraph that doesn't. Is this import supposed to provide rosgraph.get_master_uri?

@jwhendy
Copy link
Contributor Author

jwhendy commented Nov 21, 2019

Booo. So, bizarre occurrence.

  1. despite rebuilding ros-melodic-roslaunch, I think it was using the src directory pulled from your fork (vs. pulling a new tar.gz from 1.14.3) and thus using a newer version that made the call above.
  2. I also got a weird error about a missing path from ~/catkin_ws, which I think was lingering from building ros_comm from source as one attempt to troubleshoot late last night.

I'm not sure which of these was the problem, but with a definite rebuild of roslaunch on 1.14.3 and catkin clean/build, all is right with the world now. Sorry for the noise.

@jwhendy
Copy link
Contributor Author

jwhendy commented Nov 21, 2019

Created PR to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants