Speckle Server - can't send data to stream using clients

Hi everybody,

I’ve been looking forward to this for a while now, and today I’ve finally set up a Speckle v2 server! :partying_face:
I’m experiencing some issues though… :confused:

First of all, thanks for the clear Deploying a Server | Speckle Docs documentation. I’ve used the first method with docker-compose, works like a charm.

I can log into the front end, create streams, edit stream data, … using front end or clients.
I however cannot send objects to the stream using Grasshopper, Dynamo, …

I did manage to create an object and commit using the explorer:

mutation { objectCreate(objectInput: { streamId: "1dbd8c0470" objects: {test:"test"} }) }

and then

mutation { commitCreate(commit: { streamId: "1dbd8c0470" branchName: "main" objectId: "828bcef8763c1bc616e25a06be4b90ff" }) }

Any advice?

FYI, I also tested sending data to the Speckle XYZ server, and there it works (so the problem is not the GH client), only it seems that the viewer has warped my greetings:

Thanks!
Kelvin

2 Likes

Hi @kelvin! Nice to see you around these parts too :slight_smile:

Issue 1: Weird curves: doesn’t happen on our latest internal test server:

But it does happen on xyz:

This means it’s something that we fixed, and we’ll make a new release so it propagates to xyz as soon as possible.

Issue 2: It might be due to some strange mismatches in the canonical url of the server. I spy a http there, are you sure it shouldn’t be https? Or the other way around? @cristi might be able to help, but I suspect he’s out for the day (he actually should be, it’s his name day).

1 Like

Hi @kelvin ,

Does the server has any errors in the output?
You can check the server logs by going into the directory with the docker-compose file and running:

docker-compose logs speckle-server

Okay one more (@cristi thought about this): To make sure, you have your server’s account added in the speckle manager? That’s where all connectors source their credentials from. Just checking!

@kelvin, following up on this: we’ve pushed a new release of the server to production, and the curves issue is now fixed!

Here’s proof:

2 Likes

Hi guys,

Thanks for the rapid support!

@dimitrie the weird curves issue on xyz is indeed solved.
For the canonical url I use the fully qualified name to the server, as needed to access the front-end in the browser. No trailing slash, no port number, no IP. It’s all on the local network, hence the http. Should anything be changed here?

@cristi account has been added to the Speckle manager (I can use grasshopper to read/create/edit streams, I can’t however create any objects).
The Speckle-Server logs don’t show anything out of the ordinary:

The Front-end log does contain the 400 error code:

speckle-frontend_1 | xx.x.xx.xx - - [25/May/2021:10:58:06 +0000] “POST /graphql HTTP/1.1” 200 508 “-” “GraphQL.Client/3.2.2.0” “-”
speckle-frontend_1 | xx.x.xx.xx - - [25/May/2021:10:58:06 +0000] “POST /objects/6e7cfae2de HTTP/1.1” 400 25 “-” “-” “-”
speckle-frontend_1 | xx.x.xx.xx - - [25/May/2021:10:58:06 +0000] “POST /graphql HTTP/1.1” 200 261 “-” “GraphQL.Client/3.2.2.0” “-”

Any ideas?

Thanks!
Kelvin

Hmm, that 400 error seems to be the main issue.

Checking with the code, looks like one of the following issues:

  • The HTTP request is malformed
  • The file uploaded to the server doesn’t contain valid JSON
  • The ContentType header is not set correctly.

I’ve made a note to include a more detailed error in the client’s error message.

To investigate this further, we should analyze the HTTP request / response that is being sent. Are you up to using a networking tool like Wireshark to see the actual request?

Basically you can start a packet capture on your network interface, make the request that is causing the error, then stop the capture and look at the /objects/[stream_id] HTTP POST request and the server response.

I can help with the usage if you need any help.

Thanks,
Cristian

Hi @cristi

I used Fiddler (I guess that’s also ok?) to get the request and response. I’ve pasted the raw contents below.

Request:

POST http://server.domain.com/objects/6e7cfae2de HTTP/1.1
Authorization: Bearer 2b[…]
Content-Type: multipart/form-data; boundary="–obj–"
Host: server.domain.com
Content-Length: 362
Expect: 100-continue
Accept-Encoding: gzip

----obj–
Content-Type: application/gzip
Content-Encoding: gzip
Content-Disposition: form-data; name=batch-2; filename=batch-2; filename*=utf-8’'batch-2


0 e =$ I E lQMiӃ ă 6 73
8 s> .Wg’* H` n p9 8s_m %K I 9 E ZI dGHZ % b@0u ~ & 9Vѓ e i \ܶ L Z ^’{ Y P$2T$3UtZ 2I * < r J
----obj----

and the response:

HTTP/1.1 504 Fiddler - Receive Failure
Date: Tue, 25 May 2021 16:56:46 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, must-revalidate
Timestamp: 18:56:46.942

[Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned 0 bytes.

The object sent is a SpeckleObject with content “Hello”.
I must admit it has not made me wiser. Is it helpful for you?

Thanks!
Kelvin

Hi @kelvin,

I tried to reproduce this issue with various setups, but I couldn’t: I was able to send objects.

I am inclined to believe it has something to do with the setup, triggering an unexpected issue.

We’d be happy to support you further but would need access to your environment, and that would require setting up a consultancy agreement. Please let us know how you’d like to proceed.

Thanks,
Cristian

Hi @cristi,

Thanks for the support. I’ll delve a bit deeper then into the problem from our side, try a few different server setups perhaps. If I can’t find a fix, I’ll surely contact you again regarding that consultancy agreement.

A different question (let me know if you’d prefer that I open a new topic for this):
On your “Deploying a Server” instructions you mention

This setup is not recommended for use in production[…]

Could you highlight the aspects that need further attention for a production environment?
I assume this mostly relates to the setup of the server or VM that hosts Speckle Server, and not to the speckle container itself?

Kind regards,
Kelvin

Hi Kelvin! The container is the same - it doesn’t really change. The art of it is mostly what you’re looking for in a production server. @cristi might swoop in and correct me if I’m wrong.

We’re not recommending that setup for production purposes a few reasons, namely:

  • application level updates: we tend to move quite fast, and if things get busy, blink twice and you’re on an outdated server. this has security implications too.
  • guaranteed uptime: from my experience, vm’s tend to restart now and then (they need updates and reboots too), which results in downtime.
  • database backups - again this is up to you mostly on what’s your risk appetite when it comes to dealing with live data. we’re a bit more on the paranoid side, so we’ve set up replication, failover nodes and PITR.
  • end-to-end encryption: possibly less of daily concern - we’re offering from encryption at rest, to https security (SSL/TLS certs & renewal) - so whenever data travels between a client and the db it’s always encrypted, inc. inside the datacenter itself.
  • automatic scalability: for example, the preview service can be quite a monster; that setup can eat up all a vm’s resources, and starve other processes causing general system wide instability.

We’ve been burned in the past: insecure and unstable servers don’t make anyone happy, and this ended up in generalisations of “Speckle is insecure” or “Speckle is unstable”. Of course it is, if you forgot to renew your SSL cert! < insert frustration incomprehensible noises >

It’s impossible for us to manage all those aspects of making a server secure and stable for production for everybody - and develop the product, and pay the bills. As such, we’re now taking a wee bit more care in the messaging around this - and the resulting the “not recommended in production” flags. Hope this helps a bit!

Hi @dimitrie,
Yes, that is very helpful, thanks!
Gives an idea what you’re up against if you’d want to set it up yourself properly.
Kelvin

PS: we had our own little event, so couldn’t be there at the community standup, but I’ll try to join next time!

No worries re event! We’ve shared our deck (finally we didn’t forget to…) so you can still catchup on it if you want. And yes, next time! We’ll try to announce it a bit earlier than on the week, to give others more time to prepare/flex schedules :slight_smile:

PS: for some reason, 1/3rd of the conversations were around pets (this part is not in the deck).

2 Likes