Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Samples seemingly not executing workflow #242

Closed
backhand opened this issue Jan 26, 2023 · 7 comments
Closed

[Bug] Samples seemingly not executing workflow #242

backhand opened this issue Jan 26, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@backhand
Copy link

backhand commented Jan 26, 2023

What are you really trying to do?

I'm trying to run the samples here, and getting a feel for how the whole architecture of temporal works. Part of that is getting a basic workflow up and running, and being able to observe how it's scheduled, executed etc.

Describe the bug

On running the samples I tried (hello-world, hello-world-js, activities-examples) I spun up a dev cluster via docker-compose and followed the instructions for getting it started. The cluster spun up fine and seems active, UI is working, worker starts and connects, but when I run the actual workflow it seems to just silently exit out of the client.workflow.start call. All logs or attempts to write to a file works up to that point, but after that nothing happens. Not in the client.ts functions nor those in activities.ts. I'm new to this so perhaps there's a step I'm missing or I misunderstood something.

Minimal Reproduction

Output from worker:

% npm run start                                                                                                                             samples-typescript (main)

> [email protected] start
> node src/worker.js

2023-01-26T09:50:35.033Z [INFO] Creating worker {
  options: {
    namespace: 'default',
    identity: '86321@xyz-MBP',
    shutdownGraceTime: '10s',
    maxConcurrentActivityTaskExecutions: 100,
    maxConcurrentLocalActivityExecutions: 100,
    enableNonLocalActivities: true,
    maxConcurrentWorkflowTaskExecutions: 100,
    stickyQueueScheduleToStartTimeout: '10s',
    maxHeartbeatThrottleInterval: '60s',
    defaultHeartbeatThrottleInterval: '30s',
    isolateExecutionTimeout: '5s',
    workflowThreadPoolSize: 8,
    maxCachedWorkflows: 761,
    enableSDKTracing: false,
    showStackTraceSources: false,
    debugMode: false,
    interceptors: { activityInbound: [Array], workflowModules: [Array] },
    sinks: { defaultWorkerLogger: [Object] },
    workflowsPath: '/Users/xyz/Documents/workspace/samples-typescript/hello-world-js/src/workflows.js',
    activities: [Module: null prototype] { greet: [AsyncFunction: greet] },
    taskQueue: 'hello-javascript',
    shutdownGraceTimeMs: 10000,
    stickyQueueScheduleToStartTimeoutMs: 10000,
    isolateExecutionTimeoutMs: 5000,
    maxHeartbeatThrottleIntervalMs: 60000,
    defaultHeartbeatThrottleIntervalMs: 30000,
    loadedDataConverter: {
      payloadConverter: [DefaultPayloadConverter],
      failureConverter: [DefaultFailureConverter],
      payloadCodecs: []
    }
  }
}
2023-01-26T09:50:36.338Z [INFO] asset workflow-bundle-55f159d4e77301e74160.js 700 KiB [emitted] [immutable] (name: main)
2023-01-26T09:50:36.338Z [INFO] runtime modules 670 bytes 3 modules
2023-01-26T09:50:36.338Z [INFO] modules by path ./node_modules/@temporalio/ 164 KiB
2023-01-26T09:50:36.338Z [INFO]   modules by path ./node_modules/@temporalio/common/lib/ 69 KiB 18 modules
2023-01-26T09:50:36.338Z [INFO]   modules by path ./node_modules/@temporalio/workflow/ 93.1 KiB
2023-01-26T09:50:36.338Z [INFO]     ./node_modules/@temporalio/workflow/lib/worker-interface.js 9.81 KiB [built] [code generated]
2023-01-26T09:50:36.339Z [INFO]     + 12 modules
2023-01-26T09:50:36.339Z [INFO]   ./node_modules/@temporalio/worker/lib/workflow-log-interceptor.js 2.27 KiB [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] modules by path ./src/ 1000 bytes
2023-01-26T09:50:36.339Z [INFO]   ./src/workflows-autogenerated-entrypoint.cjs 591 bytes [built] [code generated]
2023-01-26T09:50:36.339Z [INFO]   ./src/workflows.js 413 bytes [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] __temporal_custom_payload_converter (ignored) 15 bytes [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] __temporal_custom_failure_converter (ignored) 15 bytes [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] ./node_modules/long/umd/index.js 43.1 KiB [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] ./node_modules/ms/index.js 2.95 KiB [built] [code generated]
2023-01-26T09:50:36.339Z [INFO] webpack 5.75.0 compiled successfully in 590 ms
2023-01-26T09:50:36.342Z [INFO] Workflow bundle created { size: '0.68MB' }
2023-01-26T09:50:36.768622Z  INFO temporal_sdk_core::worker: Initializing worker task_queue=hello-javascript namespace=default
2023-01-26T09:50:36.769Z [INFO] Worker state changed { state: 'RUNNING' }

Output from workflow:

 % npm run workflow                                                                                                                          samples-typescript (main)

> [email protected] workflow
> node src/client.js

%

Expected:

Hello, Temporal!

Environment/Versions

MacOS Ventura 13.1, Intel core i7
Node.js v19.4.0
Temporal version: 1.19.1 (also tried 1.18.5)
Run via docker-compose from the aforementioned docker-compose repo

Additional context

@backhand backhand added the bug Something isn't working label Jan 26, 2023
@bergundy
Copy link
Member

It's likely the grpc-js version issue reported here: temporalio/sdk-typescript#1033

@backhand
Copy link
Author

It's likely the grpc-js version issue reported here: temporalio/sdk-typescript#1033

That worked! Thanks for the quick response.

@diervo
Copy link

diervo commented Feb 2, 2023

I'm running into a similar issue (even after upgrading to latest and greatest grpc-js)
Server never returns with any response and I get a timeout...
(I'm running the helm/k8s version in case has something to do with that)

ServiceError: Failed to start Workflow
[...]
 code: 14,
    details: 'last connection error: failed to receive server preface within timeout',
    metadata: Metadata { internalRepr: [Map], options: {} },
    progress: 'PROCESSED'

Is anyone experiencing the sam issue?

For the record, I'm evaluating the technology, so the fact that I have problems setting up the hello world, doesn't give me much confidence at the moment... (at least on the hosted version)

@bergundy
Copy link
Member

bergundy commented Feb 2, 2023

Can you connect to a local server using temporalite or our docker compose setup?
If that doesn’t work, can you try with a fresh installation and SDK version 1.6.0?

@diervo
Copy link

diervo commented Feb 2, 2023

I'm using SDK 1.6.0 and I tried to override the grpc-js with "@grpc/grpc-js": "1.8.7" just in case, but no luck.
The weird thing is that I do see Handling connection for 7233 on the frontend-headless

The docker-compose version works just fine, so it has to be an internal misconfiguration of one of the services deployed within the cluster...

I filed a bug in the helm repo, since the sdk seems to be just fine invoked when standing up the services via docker.

@diervo
Copy link

diervo commented Feb 2, 2023

@bergundy I tried temporalite just to triple check:

If I run temporalite without the frontend ./temporalite start --headless --namespace default
Everything works just fine.

If I run temporalite with the UI ./temporalite start --namespace default, I get the following errors and the whole process enters and endless loop when the worker or the client are unable to run.

{"level":"info","ts":"2023-02-01T21:02:10.665-0800","msg":"matching client encountered error","service":"history","error":"Not enough hosts to serve the request","service-error-type":"serviceerror.Unavailable","logging-call-at":"metric_client.go:220"}

Seems like worker and client logic seem to be fine, but the services are not well configured neither for kubernetes or temporalite?
🤷‍♂️

@bergundy
Copy link
Member

bergundy commented Feb 2, 2023

Apart from that error log with temporalite, is the SDK sample working for you?

For the k8s deployment, I suggest you get support on our community slack: https://t.mp/slack.

I’m closing this issue since it is no longer relevant since the last sdk release.

@bergundy bergundy closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants