Receiving a permission denied error when attempting to deliver file to a remote host, using sr_sender. This is due to the log exchange not defaulting to xs_<user>.</user>
2016-06-22 13:16:57,946 [ERROR] Delivery failed sftp://sarra@localhost///tmp/configfile. Type: <class 'permissionerror'="">, Value: [Errno 13] Permission denied
2016-06-22 13:16:57,948 [DEBUG] Closed channel #4
2016-06-22 13:16:57,948 [ERROR] Type: <class 'amqplib.client_0_8.exceptions.amqpchannelexception'="">, Value: (403, "ACCESS_REFUSED - access to exchange 'xlog' in vhost '/' refused for user 'peter'", (60, 40), 'Channel.basic_publish')</class></class>
There is a work around, but this should not be necessary:
Go back to your configuration file and explicity add:
log_exchange xs_<user></user>
Murray, can you take a look at this?
Aren't log exchanges xl_<user> ?</user>
if so it was changed in this ticket...https://sourceforge.net/p/metpx/bugs/34/
log -> report change means... the setting is...
report_exchange xs_user
so in sr_sender is there any reason for it to go to xreport, or should it always go to xs_<username>?</username>
from Peter
when the user is a feeder, or an admin, it should go directly to xreport.
When the user is a subscriber or a source, it should go to xs_*
Made modifications. Wednesday-Thursday Aug31-Sep1
Tested Sept 1
Pushed up Sept 1
cannot find commit in origin/master
Please try to push again.
I'm confused here. I did push this up, but also along the way sr_log.py became sr_report.py. And since I have updated my git repository since then the sr_log was removed and replaced by sr_report.py. And from the looks of things my changes from sr_log are already in sr_report...specifically lines72-77.
Last edit: Murray Rennie 2016-11-25
I understand the confusion. The bug you are thinking about is indeed fixed (and closed) it is bug #34.
the fix to sr_report is there, and fine.
this bug is against the log_exchange used by sr_sender. It's the same bug, but in a different component. Sr_sender does not call sr_log so a fix to sr_log will not help. log_exchange (now report_exchange) used by all components (sr_sender, sr_subscribe, sr_sarra, sr_shovel.
If you look at your comment in this bug on Aug 28th, you see you mention sr_sender, for example... and you mention committing a change in Sept. 1st but I cannot find it in the repo (inside sr_sender.)
clarification:
sr_log/sr_report is not a logging API used by the other bits (great demo of why the name of log was changed to report... endlessly confusion!) sr_report is an independent component invoked to view or process reports of successful or failed delivery of products.
I guess rather than opening the same bug on all the different bits, it should be rephrased:
for component in [ 'sr_subscribe', 'sr_sender', 'sr_sarra', 'sr_shovel', 'sr_post', 'sr_watch' ]:
if component called by [ 'feeder' or 'admin'] then default_report_exchange = xreport.
else # component invoked by a source or subscriber
default_report_exchange = xs_<username></username>
Does it make more sense now?
Well, I have to figure this out. sr_sender.py has no nice place to ensure the right report exchange is set, and I believe it's set elsewhere. The same can be said for most of the other scripts mentioned.
Last edit: Murray Rennie 2016-12-05
sr_sender has entries for two exchanges. So should the exchange be based on the origionating broker or should it be based on the post_broker?
My test change uses the originating broker in sr_sender
Last edit: Murray Rennie 2016-12-06
pushed up a sample sr_sender.py
yes, the fix made it in.
one thing: I noticed the exchange chosen in xr_<user> ... when it failed the flow_test.sh (got permission denied errors) so I changed it to xs_<user> and it was fine. xr_<user> exchanges are for reports coming back from the system. users write everything to their source, but sr_report should (once the report routing logic fully works) read from xr_<user></user></user></user></user>