Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook Notification AttributeError #277

Closed
dwagenleiter opened this issue May 4, 2018 · 11 comments
Closed

Webhook Notification AttributeError #277

dwagenleiter opened this issue May 4, 2018 · 11 comments
Labels

Comments

@dwagenleiter
Copy link

dwagenleiter commented May 4, 2018

Hey guys,

First of all, incredible job with this project. This takes away a lot of work while trying to do TA!

Unfortunately, while trying to send data / notifications to a webhook for further processing, I am getting the following error:

Traceback (most recent call last):
File "app.py", line 45, in
main()
File "app.py", line 39, in main
behaviour.run(settings['market_pairs'], settings['output_mode'])
File "/app/behaviour.py", line 64, in run
self.notifier.notify_all(new_result)
File "/app/notification.py", line 100, in notify_all
self.notify_webhook(new_analysis)
File "/app/notification.py", line 196, in notify_webhook
new_analysis[exchange][market][indicator_type][indicator][index] = analysis['result'].to_dict(orient='records')[-1]
AttributeError: 'dict' object has no attribute 'to_dict'

It is setup according to the documentation as:

NOTIFIERS_WEBHOOK_REQUIRED_URL=http://xxx/webhook.php

Any ideas what could cause this?

Best,
David

@ghost
Copy link

ghost commented May 4, 2018

Sounds like a bug, are you able to provide what config options you are using so I can try to replicate it?

The webhook feature is quite new, so there's probably one or two nasties I haven't weeded out yet.

@ghost ghost added the bug label May 4, 2018
@dwagenleiter
Copy link
Author

dwagenleiter commented May 4, 2018

I am really just using the standard configuration described in the documentation, I didn't really get to that part yet as I wanted to write my logic first and test around.

SETTINGS_UPDATE_INTERVAL=300
SETTINGS_OUTPUT_MODE=json

SETTINGS_MARKET_PAIRS=ETH/BTC,BTC/USDT

NOTIFIERS_WEBHOOK_REQUIRED_URL=http://xxx/webhook.php

EXCHANGES_BITTREX_REQUIRED_ENABLED=true
INDICATOR_RSI_NUM_INDICATORS=2
INDICATOR_RSI_0_CANDLE_PERIOD=1d
INDICATOR_RSI_0_PERIOD_COUNT=14
INDICATOR_RSI_1_CANDLE_PERIOD=1h
INDICATOR_RSI_1_PERIOD_COUNT=14
INDICATOR_SMA_0_PERIOD_COUNT=9
INDICATOR_SMA_0_CANDLE_PERIOD=1h

@dwagenleiter
Copy link
Author

Interestingly enough, putting NOTIFIERS_WEBHOOK_REQUIRED_URL=http://xxx/webhook.php to the end of the file fixed the issue.

@ghost
Copy link

ghost commented May 4, 2018

That is quite weird... the config file is read in as environment variables so there really shouldn't be any reason for the order to matter... perhaps the issue is just inconsistent? But I will test both in either case and see if I can replicate :)

@dwagenleiter
Copy link
Author

My bad, I temporarily changed SETTINGS_OUTPUT_MODE to CSV and that configuration didn't throw the error (my webhook did not get any data though).

I have changed it back to JSON now and I am getting the error again, each time.

@ghost
Copy link

ghost commented May 4, 2018

Excellent, well I'll likely have it fixed within a week.

@dwagenleiter
Copy link
Author

Awesome, thanks!

@ghost
Copy link

ghost commented May 5, 2018

If you remove SETTINGS_OUTPUT_MODE=json from your config file completely it should work... some how the data set is being mutated when the output transform is being applied. I'm working on fixing that, but this should give you a work around in the mean time.

@ghost
Copy link

ghost commented May 5, 2018

Fixed in #280

@ghost
Copy link

ghost commented May 6, 2018

merged

@ghost ghost closed this as completed May 6, 2018
@dwagenleiter
Copy link
Author

Perfect, thank you!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant