title: Google FCM - can not subscribe to topic - returns 502 or "error INTERNAL"
body: <p>Trying to subscribe device token to a topic on server. According to <a href="https://developers.google.com/instance-id/reference/server" rel="nofollow noreferrer">FCM server docs</a> proceeding the request:</p>
  
  <pre><code>curl --header "Authorization: key=AAAA...qC1GXg" \
    --header "Content-Type:application/json" \
    -X POST  -d '{}' \
   "https://iid.googleapis.com/iid/v1/BY7kK...rbZ/rel/topics/mytopic"
  </code></pre>
  
  <p>which returns :</p>
  
  <pre><code>502. The server encountered a temporary error and could not complete your request.&lt;p&gt;Please try again in 30 seconds
  </code></pre>
  
  <p>The same 502 is returned when I'm trying to get token info with "details" parameter, like this:</p>
  
  <pre><code>curl --header "Authorization: key=AAAA...C1GXg" \
     "https://iid.googleapis.com/iid/info/BY7kK...rbZ?details=true"
  </code></pre>
  
  <p>While if not adding "details" parameter, it all ok - it returns 200 and json data:</p>
  
  <pre><code>{"applicationVersion":"24","attestStatus":"UNKNOWN","application":"com.my.app","scope":"*","authorizedEntity":"...","appSigner":"...","platform":"ANDROID"}
  </code></pre>
  
  <p>I have also tried a batchAdd:</p>
  
  <pre><code>curl --header "Authorization: key=AAAA...81GXg" \
    --header "Content-Type:application/json" \
    -X POST \
    -d '{"to":"/topics/mytopic", "registration_tokens": ["BY7k...rbZ"]}' \
   "https://iid.googleapis.com/iid/v1:batchAdd"
  </code></pre>
  
  <p>and it ends up with :</p>
  
  <pre><code>{"results":[{"error":"INTERNAL"}]}
  </code></pre>
  
  <p>Authorization key and device token I use should be OK, since I can get token data (without topics), and sending messages to that device (also using curl) works OK.
  Still, this 502 is happening for more than 24h for me so far.</p>
  
  <p>That's a new FCM project - I'm not migrating from GCM or anything. Android app is live on market for some time, but I haven't used cloud messaging there before.</p>
  
  <p>Any ideas with what could be wrong here? Thank you.</p>