You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/28 02:28:31 UTC

[GitHub] [pulsar] phuongtailtranminh edited a comment on issue #4386: Pulsar Function doesn't get started

phuongtailtranminh edited a comment on issue #4386: Pulsar Function doesn't get started
URL: https://github.com/apache/pulsar/issues/4386#issuecomment-496342166
 
 
   After checked the log file, I updated the content of file to smt like below:
   
   ```
   #!/usr/bin/env python
   #
   # Licensed to the Apache Software Foundation (ASF) under one
   # or more contributor license agreements.  See the NOTICE file
   # distributed with this work for additional information
   # regarding copyright ownership.  The ASF licenses this file
   # to you under the Apache License, Version 2.0 (the
   # "License"); you may not use this file except in compliance
   # with the License.  You may obtain a copy of the License at
   #
   #   http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing,
   # software distributed under the License is distributed on an
   # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   # KIND, either express or implied.  See the License for the
   # specific language governing permissions and limitations
   # under the License.
   #
   
   
   from pulsar import Function
   
   # The classic ExclamationFunction that appends an exclamation at the end
   # of the input
   class ExclamationFunction(Function):
     def __init__(self):
       pass
   
     def process(self, input, context):
       return input + '!'
   ```
   
   Then re-register the function with Pulsar, but then the log file shows new error:
   
   ```
   ImportError: No module named ExclamationFunction
   [2019-05-28 09:25:22 +0700] [CRITICAL] python_instance.py: Could not import User Function Module ExclamationFunction
   [2019-05-28 09:25:22 +0700] [ERROR] log.py: Traceback (most recent call last):
   [2019-05-28 09:25:22 +0700] [ERROR] log.py:   File "/Users/phuongtran/Downloads/apache-pulsar-2.3.1/instances/python-instance/python_instance_main.py", line 211, in <module>
   [2019-05-28 09:25:22 +0700] [ERROR] log.py: main()
   [2019-05-28 09:25:22 +0700] [ERROR] log.py:   File "/Users/phuongtran/Downloads/apache-pulsar-2.3.1/instances/python-instance/python_instance_main.py", line 192, in main
   [2019-05-28 09:25:22 +0700] [ERROR] log.py: pyinstance.run()
   [2019-05-28 09:25:22 +0700] [ERROR] log.py:   File "/Users/phuongtran/Downloads/apache-pulsar-2.3.1/instances/python-instance/python_instance.py", line 196, in run
   [2019-05-28 09:25:22 +0700] [ERROR] log.py: raise NameError("Could not import User Function Module %s" % self.instance_config.function_details.className)
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services