rollbar-php icon indicating copy to clipboard operation
rollbar-php copied to clipboard

Error when running rollbar-agent service

Open Vishal20081990 opened this issue 3 years ago • 4 comments

I'm trying to use rollbar-agent for asynchronous log reporting for php project (Using Codeigniter framework).

Whenever I try to start the rollbar-agent service below error is logged in /var/log/rollbar-agent.log

/usr/bin/python: can't find '__main__' module in '/usr/local/rollbar-agent'

Can anyone help me out?

Vishal20081990 avatar Feb 04 '22 05:02 Vishal20081990

This tells us Python can't find the rollbar-agent entry point to execute. There are a few reasons this could be.

  • The symbolic link path is incorrect https://github.com/rollbar/rollbar-agent#set-up-the-rollbar-agent-service.
  • There was an error setting up the virtual environment. If some of the files were not copied correctly, that could result in that issue.

If you run ls in your terminal inside the virtual environment directory you should see the following files from rollbar-agent.

LICENSE
requirements.txt
rollbar-agent
rollbar-agent-init.sh
rollbar-agent.conf

To test it you should be able to test the agent is running by following these steps...

  1. Activate the virtual environment. source ./<venv name>/bin/activate should do the trick.
  2. Start the agent manually python rollbar-agent. You may need to run with escalated permissions.
  3. Once you are done you can deactivate the virtual environment with the deactivate command.

danielmorell avatar Mar 10 '22 14:03 danielmorell

Thank you for replying @danielmorell !!

I'm not using virtual environment.

When I tried running python rollbar-agent it worked perfectly, Application error log files were getting parsed and I received the Rollbar notifications over email as well.

But when I start the Rollbar service using service rollbar-agent start , Application error logs are not getting parsed and same error which I mentioned in above question is getting logged in /var/log/rollbar-agent.log

Screenshot 2022-04-29 at 6 44 36 PM

Vishal20081990 avatar Apr 29 '22 12:04 Vishal20081990

Can you provide the contents of your rollbar-agent service file?

danielmorell avatar May 12 '22 13:05 danielmorell

What do you get when you run...

$ service rollbar-agent status

danielmorell avatar May 23 '22 19:05 danielmorell

I am going to close this issue due to inactivity.

danielmorell avatar Nov 18 '22 14:11 danielmorell