# Is the API blinking in and out?

**URL:** <https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631>\
**Category:** GraphQL API\
**Created:** [July 30, 2020, 7:25pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631 "2020-07-30T19:25:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [July 30, 2020, 7:25pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/1 "2020-07-30T19:25:21Z")

</div>

Hello!

I’m getting a lot of “Service not available” (code 21) and “Unexpected error” (code 22) errors in queries that normally give me no errors. This has been going on since at least 3:00pm EDT today, July 30.

Here are some request IDs I got back when trying to use the picks\_per\_day query:

5f231e2a88423e6591ebe6cb (with the code 21)  
5f231d024ddb2e80aa367089 (with the code 22)

The [ShipHero Status page](https://status.shiphero.com/) shows that everything should be operational, but I can’t get back any results.

Thanks!

(sorry to tag you right away, @tomasw, but if something is down, I just want to make sure it gets seen quickly.)

---

<div class="post-metadata">

**Author:** ![jwz](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jwz](https://community.shiphero.com/u/jwz)\
**Post date:** [July 30, 2020, 7:49pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/2 "2020-07-30T19:49:34Z")

</div>

Hi,

We have been having the same issues since ~11:30am PT as well.

5f2313604ddb2e80aa364d80  
5f2313c74ddb2e80aa364f48

Thanks also!

---

<div class="post-metadata">

**Author:** ![fairweather](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fairweather](https://community.shiphero.com/u/fairweather)\
**Post date:** [July 30, 2020, 7:50pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/3 "2020-07-30T19:50:34Z")

</div>

Me as well. Getting code 22 on my end doing the simplest of queries. Can you provide an update on what is going on or what has changed?

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [July 30, 2020, 8:03pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/4 "2020-07-30T20:03:23Z")

</div>

Hi @fairweather @jwz @jeremyw  
I apologize for that, the API should be back to normal now.  
We had an issue with one of our recent deploys but it has been resolved now.  
Please let me know if there is anything else I could help with.  
Thanks for the patience  
Tom

---

<div class="post-metadata">

**Author:** ![fairweather](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fairweather](https://community.shiphero.com/u/fairweather)\
**Post date:** [July 30, 2020, 8:14pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/5 "2020-07-30T20:14:11Z")

</div>

Did allocation\_priority go back to a bool?

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [July 30, 2020, 10:16pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/6 "2020-07-30T22:16:46Z")

</div>

Right now it is as Boolean @fairweather  
I apologize for that, the rollback we had to do about that last deploy made this change to go back to Boolean.  
We are currently working on fixing this so we can get the change back On.  
I will update as soon as I have more information about it.  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 3, 2020, 10:08pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/7 "2020-08-03T22:08:35Z")

</div>

Hi @fairweather!  
I just wanted to let you know that the field for `allocation_priority` should now be an Int again  
Thanks again for the patience while we worked on it  
Tom

---

<div class="post-metadata">

**Author:** ![fairweather](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fairweather](https://community.shiphero.com/u/fairweather)\
**Post date:** [August 4, 2020, 4:05am UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/8 "2020-08-04T04:05:18Z")

</div>

Thanks. I figured you must have pushed the change when my integration broke and the error messages started pouring in. Is there a notification system where we can know exactly when these changes are happening?

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 4, 2020, 2:07pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/9 "2020-08-04T14:07:16Z")

</div>

I apologize for that @fairweather  
Changes should not be like this one anymore. Our practice is to deprecate the field and create a new one, that way we don’t impact existing integrations. This case was an exception and we do not intend to make it this way again.  
On the other hand, communications are handled by announcements on community and over email (depending on how impacting they are)  
We are working on improving our communication skills so announcements are done as expected through community announcements  
Would you rather have an mailing list to subscribe to? Maybe I could make that possible  
Thanks again for the patience!  
Tom

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [August 12, 2020, 12:57am UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/10 "2020-08-12T00:57:38Z")

</div>

Hi @tomasw,

Ever since I first posted this almost 2 weeks ago, I’m still running into frequent incidents where the API will spin for 60 seconds and then return with an error code 22 “Unexpected error”. I’m running into it more with the picks\_per\_day and packs\_per\_day queries when filtering with a date\_from. Below are several request IDs from the last 10 minutes (between about 8:35pm EST and 8:45pm EST on Tue, Aug 11, 2020), but I run into this all through the day. Often times I will get one or two failures, and then the same unaltered query will return a valid result on subsequent tries. It’s making data gathering very painful, and testing of new code nearly impossible.

packs\_per\_day:  
5f333b0fa01d03ec1889c78d

picks\_per\_day:  
5f32f3f0d16d451af7201738  
5f3339c1d973260123132ff7  
5f333a3c566216d4eb40b2b4  
5f333a89accf2d936aaab791

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 13, 2020, 1:28am UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/11 "2020-08-13T01:28:36Z")

</div>

Hi @jeremyw  
Thanks for those examples. I opened an investigation about this.  
For those request ids you get the error, right?  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [August 13, 2020, 1:40am UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/12 "2020-08-13T01:40:46Z")

</div>

Hi @tomasw,

Correct. Those are all ones where I got error code 22.

Thanks!

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [August 19, 2020, 11:40am UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/13 "2020-08-19T11:40:16Z")

</div>

Hi @tomasw,

Has there been any update on this? Here’s another failed (code 22) request id: 5f3d0a26c10e28be300fd976

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [August 24, 2020, 7:42pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/14 "2020-08-24T19:42:01Z")

</div>

Hi @tomasw,

I’m still looking for updates on the connection issues with the API. I’m still frequently getting code 22 “Unexpected Error” when running queries, but sending the query again on subsequent tries (even without changing the query) will sometimes yield results, although it may take several attempts. Part of the big issue with this is that for each of these code 22 returns, it takes a full minute for the result to come back, making the run time a lot longer than when it successfully gives results.

Here are more request\_ids for queries that are coming back code 22:

5f4402bb1537ca9bdeefa8de  
5f44135c20162f5eee8f0652  
5f4413a6bfa5196c9c0df9f3  
5f44151e863baae7169787f7  
5f441570bfa5196c9c0e001b

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [August 26, 2020, 12:50pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/15 "2020-08-26T12:50:00Z")

</div>

I ran across something that my be a useful piece of information. When I run these queries (in the case of the last set of code 22 responses, the packs\_per\_day query) I’ve been using the date\_from criteria (set to the last day or two) and using first:1 to get the first record. Those are the ones where I often get the code 22 errors. But I found that if I specify an order number in the criteria, not only does it seem to work every time, but it seems to come back much faster. Querying without an order number, even when returning a single record, will sometimes take 45 seconds or so when it doesn’t return an error. Specifying an order number takes a second or less to get the same record.

Unfortunately, I cannot specify orders for every packing record I need to pull, but seeing your response [in this other thread](https://community.shiphero.com/t/purchase-order-unknown-22-error/686/5) about the possibility of nonexistent SKUs made me think something like that may be going on.

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [August 26, 2020, 5:42pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/16 "2020-08-26T17:42:06Z")

</div>

Hi @jeremyw!  
I apologize for the delayed response. Our engineers are still working on this issue. I will post here as soon as they have an update about it

On the other hand, if you use the user\_id filter does it improve speed?

Something like this:

```
query {
  packs_per_day(
	user_id:"VXNlcjoxNzMzNJ=="
    date_from: "2020-08-24"
  ) {
    request_id
    complexity
    data {
      edges {
        node {
          id
          shipment_id
          warehouse_id
          total_items
          unique_items
          barcodes_scanned
          created_at
          order {
            id
            order_number
          }
        }
        cursor
      }
    }
  }
}

```

You could get the user\_id using the legacy\_id with this Query

```
query{
  uuid(legacy_id: 9123, entity: User){
    request_id
    complexity
    data {
      id
    }
  }
}

```

Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [September 9, 2020, 7:30pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/17 "2020-09-09T19:30:00Z")

</div>

Hi @tomasw,

Specifying the user\_id didn’t seem to make much difference. But doing that wouldn’t be a good long term solution anyway because I need to be able to pull data for all users, and from what I can tell, there isn’t a query that will give me a full list of users in the system. I would have to maintain that manually outside of the system and scripts.

Has there been any update on the issue otherwise? I’m still running into the code 22 Unexpected Errors.

Here are 3 failed request\_ids from around 3:20PM EDT ON 9/9/2020:  
5f5929668ad53b4bb26e0725  
5f5929a637f0febc949108a3  
5f5929e5311c485fb61d7f90

This fourth request\_id was the exact same query that went through a minute or two later:  
5f592ad7311c485fb61d7fed

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)\
**Post date:** [September 10, 2020, 5:39pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/18 "2020-09-10T17:39:29Z")

</div>

Hi @jeremyw ur engineering team was working on improving the performance lately, so I just submitted those new examples and asked for an update.  
I will let you know as soon as I have more information about this.  
Thanks again for the patience!  
Tom

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [September 10, 2020, 5:56pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/19 "2020-09-10T17:56:30Z")

</div>

Thanks, @tomasw. I just wanted to include any new information just in case any differences from one to the next helps find a pattern. 🙂

Jeremy

---

<div class="post-metadata">

**Author:** ![jeremyw](https://avatars.discourse-cdn.com/v4/letter/j/3da27b/32.png) [@jeremyw](https://community.shiphero.com/u/jeremyw)\
**Post date:** [December 16, 2020, 1:35pm UTC](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631/20 "2020-12-16T13:35:10Z")

</div>

Hello, @tomasw!

I’ve been having a heck of a time this morning with getting the code 22 Unexpected Errors this morning. My query for downloading picks\_per\_day keeps timing out and giving me the error. The request\_ids from my failed attempts so far this morning (from about 8am EST through current, which is about 8:35am EST) follow:

5fda072e2ee0102c86bfef63 (timed out on the first try)  
5fda08925b7621275dcfcc7d (got through 57 pages, or 5700 picks, before it suddenly timed out again)  
5fda0aa904decac099995659 (got only 1 page and then timed out again)  
5fda0c5cfb7dfee8707d079f (got through 3 pages and then timed out again)

Thanks,  
Jeremy

[Next page](https://community.shiphero.com/t/is-the-api-blinking-in-and-out/631.md?page=2)
