TypeError on getblog via Beem - Multiple Nodes TestedsteemCreated with Sketch.

in utopian-io •  last month

BLUF

image.png

Means "Bottom Line Up Front" for the Uninitiated

This issue is currently causing an interruption in the functionality of the @steemflagrewards bot due to Type Errors experienced with get_blog().

It is possible that the issue issue is related to the Steem RPC node API and not exclusively Beem but, nevertheless, this is the symptom and will require more advanced troubleshooting to isolate.

I can "band-aid" the issue by removing the get_blog() method invocation on our status command and report posting functionality but this will result in our bot being unable to regulate it's posting frequency which is less than ideal with the number of distinct flaggers we go through daily. Our current posting threshold is 9 distinct flaggers which, when there is a lot of abuse on the horizon, we can hit in a matter of 30 minutes.

We have had a drastic increase of flaggers via functionality our friend @reazuliqbal has provided with his flag trail which is an extremely useful tool he has provided along with repository as well as the Discord server and bot he maintains. This trail results in our rapidly hitting the flagger threshold and removing rewards from Steem abuse. after flags have been properly vetted and approved by our mods.

image.png
Isn't it glorious?

I did want to use this post as an opportunity to point out that the flag trail submission is a severely undervalued post and ask the community to please take a look at give a second opinion to @codingdefined's review which, in my humble opinion was a horrible job as he commented favorably but scored the contribution low without constructive feedback. If there was ever a @utopian-io moderator review I would flag, this one is it. I made sure to let him know while I was at it. @knowledges said he would work to correct this but we're at the 5th day of the post; therefore, I am now making my appeal to the community for enhanced curation.

image.png

I was much more fond of @pjau's alternative review.

image.png

With that, let's get back to the bug report...

Project Information

Expected behavior

The following line would obtain the account's last main post.

post = sfr.get_blog(limit=1)[0]

Which is used by the @steemflagrewards to implement our posting frequency limit (1 report / 4 hours) and status command containing link to last report. Both are non-functional as a result.

image.png

It has been working up until earlier today. I've successfully ensured the library was up to date but issue persists.

Actual behavior

image.png

How to reproduce

You may reproduce the bug interactively as follows:

from beem import Steem
from beem.account import Account
from beem.comment import Comment
stm = Steem(nodes='<insert node>')
sfr = Account('steemflagrewards', steem_instance=stm)
post = sfr.get_blog(limit=1)[0]

Which results in error as follows:

Traceback (most recent call last):
File "", line 1, in
File "/home/sfr/miniconda3/lib/python3.6/site-packages/beem/account.py", line 738, in get_blog
Comment(c["comment"], steem_instance=self.steem) for c in self.steem.rpc.get_blog({'account': account, 'start_entry_id': start_entry_id, 'limit': limit}, api='follow')["blog"]
TypeError: list indices must be integers or slices, not str

  • Browser/App version: Beem version 0.20.16

  • Operating system: Ubuntu 18.04.1 LTS

Recording Of The Bug

EF08F3C5-EB8F-4BD2-A4AE-038D96E282F0.GIF

GitHub Account

https://github.com/anthonyadavisii

Nodes attempted

-https://api.steemit.com
-https://gtg.steem.house:8090
-https://anyx.io

Would you like to delegate to the Steem Flag Rewards project and promote decentralized moderation? It's much more fashionabe than self-voting. Here are some handy delegation links!

50 SP 100 SP 500 SP 1000 SP

Last but not Least

Please, consider following the @sfr-mod-fund Fanbase on SteemAuto to support the activity of our 9 moderators regularly reviewing and approving legitimate community flags. It's your support that keeps the ball rolling and I greatly appreciate it!

Steem Cop Signing Out


When you get the off-brand idubbbz but for the Steem Blockchain, you get...
steem_cop_profile.PNG

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hey @anthonyadavisii, this is a node issue. The Steemit node has disabled the get_blog call (among others) with the switch to hivemind: https://steemit.com/steemit/@steemitdev/upcoming-changes-to-api-steemit-com

Your code has a little typo, so you didn't actually test with other nodes: The Steem() constructor takes a node= parameter, not nodes=. Here's the working version:

from beem import Steem
from beem.account import Account
from beem.comment import Comment
stm = Steem(node='https://anyx.io')
sfr = Account('steemflagrewards', steem_instance=stm)
post = sfr.get_blog(limit=1)[0]

This fails with the steemit node as expected, but works with other nodes.

·

So, it was still probably hitting the Steemit node the whole time with the previously issued set_shared_steem_instance? (which I did not mention was used in my session)

I would have expected a different error so maybe it fails over to the default node transparent to the user which threw me off.

Anyways thanks for catching that. Bot is now fully operational thanks to you, @crokkon!

·

Thank you for your review, @crokkon! Keep up the good work!

Hi @anthonyadavisii,
I was asked to also review this post as Utopian bug report. I was in contact with Holger and he confirmed that, despite being related to the changes to the Steemit node, the node output could be handled in beem, therefore accepting it as a bug report for beem. Your post contains a lot of SFR background information on how you use this functionality. This is not directly related to the bug report, but I assume this is meant to provide context to the readers. It has become common practice to include the version number in the title, but I'd consider this a minor detail. The steps to trigger the error are (beside the small typo mentioned in my other comment) clear and allow the maintainer to reproduce the issue. Thanks for your report!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.

PS: I personally strongly dislike the call for flags on the mod review at this place. I hear your position and don't have a full picture myself, but I saw this issue is being discussed in length on Discord.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

·

Thanks, @crokkon. Will take note of the version number and try to stick to more essential information.

the node output could be handled in beem

So, you're saying the key error was related to something other than a disabled plug-in? Perhaps, something transient?

PS: I personally strongly dislike the call for flags on the mod review at this place. I hear your position and don't have a full picture myself, but I saw this issue is being discussed in length on Discord.

Yes, I admit I went overboard but am still conflicted on the apparent precedent of not flagging a mod comment for disagreement of rewards. There were a few aggravating factors which earnestly caused me to believe his review was not worth it's pending payout.

After this ordeal, I do not plan on ever flagging a mod comment again even if I think it may be overvalued as I have learned the correct process of submitting a ticket for such issues.

In any case, I think mods should make a reasonable effort to leave meaningful and contructive feedback especially if they are going to give something critical score as otherwise it seems hypocritical.

I'll work on being more tactful and patient. Thank you.

·
·

So, you're saying the key error was related to something other than a disabled plug-in? Perhaps, something transient?

beem was primarily designed to talk to a steemd daemon, directly via wss or proxied via https. What Steemit did recently, was to replace the steemd daemon behind api.steemit.com with a hivemind instance, which has partly identical, partly similar and partly completely different output compared to steemd. get_blog is not officially ported to hivemind and Steemit makes no guarantees on the availability of this call. Currently, the output is at least different than on a steemd instance, which made beem fail with the type error you discovered.

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 17 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

I upvoted your contribution because to my mind your post is at least 8 SBD worth and should receive 184 votes. It's now up to the lovely Steemit community to make this come true.

I am TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

·

Hi @anthonyadavisii!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.555 which ranks you at #1850 across all Steem accounts.
Your rank has improved 2 places in the last three days (old rank 1852).

In our last Algorithmic Curation Round, consisting of 471 contributions, your post is ranked at #66.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers appreciate your great work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

·

Been hoping my rise in engagement would raise my score more considerably. Seems I'm kind of stuck no matter what I do.¯_(ツ)_/¯

I kind of hate how the formula has an implicit trust on the witnesses but I guess it's better than the alternative.

Posted using Partiko Android

Hi, @anthonyadavisii!

You just got a 7% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @anthonyadavisii!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!