eduardoboucas / staticman

đź’Ş User-generated content for Git-powered websites
https://staticman.net
MIT License
2.42k stars 544 forks source link

Cannot add collaborator - Invitation not found #227

Closed Eeemil closed 5 years ago

Eeemil commented 6 years ago

I'm trying to add staticmanapp as a collaborator to my repository (https://github.com/Eeemil/blog), but whenever I've tried to go accept the invite by either https://api.staticman.net/v2/connect/Eeemil/blog or https://api.staticman.net/v2/connect/eeemil/blog (for trying case sensitivity) it just says "Invitation not found".

screenshot

HaoZeke commented 6 years ago

I have also been facing this issue. If it helps, mine is a private repo.

Eeemil commented 6 years ago

When I tried https://api.staticman.net/v2/connect/Eeemil/blog again ~18 hours later, it worked and I received an OK. For me, the issue is resolved but I'll wait for a developer to mark this as solved if this issue is affecting more people.

Perhaps there is a delay from inviting staticmanapp untill the invite can be accepted? If so, this should be documented on https://staticman.net/docs/

HaoZeke commented 6 years ago

I think this is an intermittent server load problem, since I am still getting the invitation not found error.

kulbhushanchand commented 6 years ago

I am facing the same problem

HaoZeke commented 6 years ago

Mine was also automatically resolved in a day or so. I guess there's a waiting list.

josineto commented 6 years ago

I have the same problem. I sent the invitation 18 hours ago, and using the accept link, I've received the JSON message "Too many requests in this time frame", and a date for the next allowed request. I reloaded the page, and the "Invitation not found" message appeared.

Now, same steps happen: first a JSON message, "Too many requests...", and in second page load, "Invitation not found"... Still I don't have the invitation accepted.

kulbhushanchand commented 6 years ago

It's been 7 days, and still invitation pending or too many requests.

If @eduardoboucas may check for the issue (he is the creator of staticman).

akmur commented 6 years ago

Same here :)

sfi0zy commented 6 years ago

I have the same issue. It just returns "Invitation not found".

MichaelRumpler commented 6 years ago

I also get "Invitation not found". Looks like I have to wait.

morningspace commented 6 years ago

Me too... keep getting the same "Invitation not found"...

samarulmeu commented 6 years ago

Same thing here also. Two test sites and the invitations are not found.

ricardonadao commented 6 years ago

Same here, did anyone got it sorted?

morningspace commented 6 years ago

No lucky at all. I tried multiple times by re-adding the staticmanapp, waiting even a couple of days, still got "Invitation not found". It looks the service is completely stop working... I don't know what we could do until someone to take look at the hosted service? It's not something wrong in code that we could fix by issuing a PR. It's the deployment env that we couldn't touch... :-(

eduardoboucas commented 6 years ago

Sorry, I’m AFK for a few days, but I’ll have a look when I get back on Sunday or Monday. The “Too many requests” is a message from the GitHub API indicating that we’re over the limit, I wonder if the “Invitation not found” is a similar thing, i.e. the user being added to too many repos.

ricardonadao commented 6 years ago

Thank you Eduardo, boas ferias ;)

kulbhushanchand commented 6 years ago

After 10 days, I got OKresponse. Comments on my blog working now. đź‘Ť

janiceleng commented 6 years ago

no response from me either...

janiceleng commented 6 years ago

does anyone have any updates on this issue?

josineto commented 6 years ago

I got OK two days ago. Perhaps this is an intermitent issue...

samarulmeu commented 6 years ago

I never got OK... More than a week of waiting...

maxime-michel commented 6 years ago

Isn't there a possibility that this issue is affecting comment submissions as well?

VincentTam commented 6 years ago

If this issue is urgent, why don't consider setting up your own API instance? Provided you have a (free) Heroku account, the whole setup can be done under fifteen minutes.

maxime-michel commented 6 years ago

Indeed, this is also the suggested solution in https://github.com/eduardoboucas/staticman/issues/222.

However, it is not explicitely described anywhere yet that to make sure all submitted comments on your site get processed, you should deploy your own. It reduces the appeal quite a bit, too. As far as I'm concerned, I would rather pay a small fee than have to deal with that.

VincentTam commented 6 years ago

However, it is not explicitely described anywhere yet.

The second link of my previous comment does describe the whole process of hosting it on a Heroku free dyno. If you follow it, you will have your own API instance built within a quarter of an hour.

"GitLab does not have collaborator invites, so this is currently not required for Staticman to collaborate on a project. The user can just add Staticman immediately." -- #219

Moreover, with #219, you may bypass this problem by using GitLab pages. In fact, users in #22 has reported an array of advantages of GitLab over GitHub, for example, native CD/CI support.

The screenshot below illustrates my demo GitLab Pages (Source). From the timestamp in each commit, it's clear that this site was built while @staticmanapp was "on holiday". How does this works? I've built my own API instance and GitHub/GitLab bot @staticmanlab.

screenshot from 2018-09-17 04-06-36


"Not that I'm aware of. Could you create one?"

As a consequence of @eduardoboucas's request, I've really built one running on a free Heroku dyno to test the newly available #219 GitLab suuport. The associated Git* bots are both named @staticmanlab.

maxime-michel commented 6 years ago

(Sorry, I wasn't talking about the deployment process, for which you've given an excellent and totally clear link, I was talking about the Staticman getting started: it doesn't mention these potential API limit problems yet.)

VincentTam commented 6 years ago

@maxime-michel I see your point. It's better to mention this limitation at the very beginning, so that users can choose between

  1. use public API instance
  2. setup own API instance

This is more efficient as @staticmanapp will receive less invitations.

saifulmuhajir commented 6 years ago

This still happened to me after waiting for five days. The response is still 'invitation not found'. Is there any workaround for this?

Thanks

VincentTam commented 6 years ago

@saifulmuhajir As depicted on Staticman's set, Staticman functions basically like a :truck: truck which POSTs HTML :page_facing_up: form data into your GitHub/GitLab repo :file_folder: (running on any GitHub/GitLab server).

When a bus is not working, passengers would be asked to take another one. Similarly, for a workaround, you can use my API instance (built at the request of @eduardoboucas for testing #219) or even build your own instance within Heroku's free tier.

saifulmuhajir commented 6 years ago

@VincentTam thanks. I'll try those options.

VincentTam commented 6 years ago

@saifulmuhajir To bypass this invitation problem, why not try GitLab Pages? In GitLab, there's no such invitation mechanism---you just add the bot (say @staticmanlab) into the contributing members.

If you really love open source, migrating from the proprietary GitHub to open souce GitLab, which has native CD/CI support, will free you from the aforementioned GitHub API limit.

kulbhushanchand commented 6 years ago

@VincentTam Apart from initial invitation, does GitLab suffers from bottleneck because of many users using same @staticmanapp and thus some of the comments not getting processed?

I meant to say what if everyone is using same GitLab app for staticman?

VincentTam commented 6 years ago

@Kulbhushan-Chand I don't know about that, but a quick search points me to a GitLab forum question " Does GitLab have an API rate limit". The last comment lists out several endpoints which control the traffic. Hope that helps.

The last question is precisely the problem. Now the :truck: is overloaded. One may either wait (for an indefinite time period) for a larger truck, or build his/her own one. Building the former costs surely a fortune, while building the later for a personal blog can be free.

maxime-michel commented 6 years ago

It would be nice to have a breakdown of the usage. Does somebody really believe that there's enough Staticman-powered websites for the bot to hit 5k requests an hour? I have a feeling that if anything, it is a spam problem that we have.

kulbhushanchand commented 6 years ago

@VincentTam Furthur exploring the link in the last comment that you mentioned, points thay GitLab indeed have api request limit image

Also mentioned here

Which means it is a matter of time when enough people use someone's / their own's GitLab api and hit 600 req/min.

Looks like self hosted instance for your personal use only is the safe option, BUT that too only upto the limit that the number of users commenting on your self hosted staticman api should not collectively generates more than 600 req/min.

saifulmuhajir commented 6 years ago

This is a matter of scalability indeed.

Maybe we'll end up building federated commenting (API) system where people can build their API servers (with their request limits) and join them with existing ones.

Also, if @Kulbhushan-Chand picture says 600 req/min/IP that's actually good enough for normal people because one IP should have less than 600 requests per minute.

kulbhushanchand commented 6 years ago

@saifulmuhajir Rightly said -

for normal people it is good enough

but only if they have deployed their own personal api instance. If group of staticman users ends up using the same api, the limit will be easily achieved.

As mentioned by @VincentTam here about the steps of deployment, it is still not easy for majority of people.

maxime-michel commented 6 years ago

If group of staticman users ends up using the same api, the limit will be easily achieved.

Wait, what? Let's say 50 people use the same deployment. 600 req/min / 50 sites = 12 requests per minute per site. That means at the end of the week, each site would have received a maximum of 12*60*24*7 = 120k comments.

The same math applied to GitHub means 50 sites each get a maximum of 16k comments per week.

On my most visited website (800-1000 daily visits), I get maximum 10 comments a week. I have Staticman running on 3 sites so in the end even that 'high figure' gets drowned into a very low average of 3. Am I missing something or is some spammer abusing the tool?

kulbhushanchand commented 6 years ago

đź‘Ť Thanks for the math part. Honestly I didn't calculate the numbers when commenting.

Even 12 request per minute per site can be a bottleneck at the peak time of the site visit (only for some very interesting article/site). (Please note I don't have any research fact)

With the growing popularity of staticman, there can be more than 50 people using some specific api instance (this is what happening now with @staticmanapp on github).

I am sure with the use of reCaptcha with staticman, spamming is negligible.

maxime-michel commented 6 years ago

50 was just an example to show we have an extremely large comments per minute / site ratio at our disposal. Yet people have been consistently unable to add Staticman as a collaborator for a month. In my opinion, either we have too many unmaintained sites that weren't set up with captchas and get spam, or somebody is deliberately bricking the instance.

kulbhushanchand commented 6 years ago

If someone deliberately bricking it, the best way is -- hitting the api from different IPs concurrently to reach the limit per minute using https://api.staticman.net/v2/entry/{GITHUB USERNAME}/{GITHUB REPOSITORY}}

In any-case we need data/log (if available) of @staticmanapp to find out the cause.

VincentTam commented 6 years ago

Staticman's demo site Popcorn receives thousands of commits a day. Maybe that uses up the API quota.

maxime-michel commented 6 years ago

Excellent catch, @VincentTam. I vote for adding a captcha or an Akismet key to that site.

kulbhushanchand commented 6 years ago

@VincentTam Allow me to correct, by commits if you mean pull requests. Since there are only 30 commits out of which only few are caused by staticman comment entry.

However, there are > 3000 opened pull requests caused by staticman, but spanned over last two months. There are only 13 pull requests in the lat 24 hours.

I am sure this is not the cause for eating away of API quota.

maxime-michel commented 6 years ago

I just spammed said form a little and noticed that while I still can't add Staticman to my repository, my comments got through just fine. What the hell is going on? If we're hitting the API limit, we would hit it for all cases.

VincentTam commented 6 years ago

@Kulbhushan-Chand @maxime-michel Thannks for doing the math. In fact, since the public (production and development and my own) API instances are powered by Heroku apps, they are subject to both Heroku and GitHub/GitLab's limits. From it's server response time to a GET request to /, the first instance isn't run on the free dyno, whereas the other two are.

From a server-side point of view, the traffic from GET requests to / and /favicon.ico and POST requests with status 500 (possibly due to GitHub/GitLab repo owners who wish to test/use Staticman) are also considerable.

Since the documentation for Staticman v3 in #219 has not yet been integrated to the official site, it's possible that a user has forgotten to supply the Git service provider when firing a POST request to the /entry endpoint, like

POST /entry/v3/user/repo/branch/property (wrong URL!)

he/she may keep trying until he/she hits status 427 "too many requests" or he/she gets tired of status 500 "internal server error".

For the case of the public production instance (still running v2), it has to handle requests with wrong endpoint path/request body from GitHub repo owners, who might fire (a multitude of invalid POST) requests over a short period of time.

Lacking knowledge in networking, while testing Staticman with a sample GitHub repo, I've tried sending POST requests from the famous RESTclient, but all of them failed with a status 500. Finally, I've given up those request clients and coded a HTML form. As a result, the project has been expanded to a minimal Jekyll+Staticman v3 GitHub Pages. staticman-ok Looking back, if I had kept trying RESTclient, I might have hit the bottleneck of my own API instance without building anything.

kulbhushanchand commented 6 years ago

@VincentTam That seems to be working fine. I added few test commits to your link. Even @staticmanapp (GitHub app) is working fine on my personal-website. However for another repo of mine, I am still waiting for OKreponse from @staticmanapp for the last 20 days.

matdoering commented 6 years ago

I'm also having the same issue when contacting the API - I'm getting "Invitation not found" although I submitted one a couple of hours earlier. So there's no solution yet except to host your own API?

VincentTam commented 6 years ago

@matdoering Switching to GitLab can bypass this. You may see my sample GitLab page powered by Staticman v3 and its source code for details.

matdoering commented 6 years ago

@VincentTam Thanks for the advice! Since switching to GitLab wasn't an option for me, I instantiated my own version of the Staticman API. It was actually quite easy thanks to your great description in your blog post.

To share my experience, I just wrote a blog post about getting the Staticman API running and getting the commenting system working for Hugo.