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

Getting 403 on chat ui config for aws sagemaker endpoint #1486

Open
nauts opened this issue Sep 25, 2024 · 0 comments
Open

Getting 403 on chat ui config for aws sagemaker endpoint #1486

nauts opened this issue Sep 25, 2024 · 0 comments
Labels
support A request for help setting things up

Comments

@nauts
Copy link

nauts commented Sep 25, 2024

Hi All,

Looking into configuring chat ui with aws sagemaker endpoint and getting following error:
image

DOTENV_LOCAL was found in the ENV variables. Creating .env.local file.
{"level":30,"time":1727231014113,"pid":23,"hostname":"fbe21dc3ad38","msg":"Starting server..."}
{"level":30,"time":1727231014147,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] Begin check..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Update search assistants\" already applied. Skipping..."}
Listening on 0.0.0.0:3000
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Update deprecated models in assistants with the default model\" should not be applied for this run. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Add empty 'tools' record in settings\" already applied. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Convert message updates to the new schema\" already applied. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Convert message files to the new schema\" already applied. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Trim message updates to reduce stored size\" already applied. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] \"Reset tools to empty\" already applied. Skipping..."}
{"level":30,"time":1727231014175,"pid":23,"hostname":"fbe21dc3ad38","msg":"[MIGRATIONS] All migrations applied. Releasing lock"}
{"level":30,"time":1727231014207,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"createdAt","span":"day","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014216,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"updatedAt","span":"day","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014219,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"createdAt","span":"day","type":"message","msg":"Computing conversation stats"}
{"level":30,"time":1727231014220,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"updatedAt","span":"week","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014224,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"createdAt","span":"week","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014227,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"createdAt","span":"month","type":"message","msg":"Computing conversation stats"}
{"level":30,"time":1727231014229,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"createdAt","span":"day","type":"conversation","msg":"Computed conversation stats"}
{"level":30,"time":1727231014229,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"updatedAt","span":"day","type":"conversation","msg":"Computed conversation stats"}
{"level":30,"time":1727231014230,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-25T00:00:00.000Z","dateField":"createdAt","span":"day","type":"message","msg":"Computed conversation stats"}
{"level":30,"time":1727231014230,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"updatedAt","span":"week","type":"conversation","msg":"Computed conversation stats"}
{"level":30,"time":1727231014231,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"createdAt","span":"week","type":"message","msg":"Computing conversation stats"}
{"level":30,"time":1727231014235,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"createdAt","span":"month","type":"message","msg":"Computed conversation stats"}
{"level":30,"time":1727231014236,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"createdAt","span":"week","type":"conversation","msg":"Computed conversation stats"}
{"level":30,"time":1727231014236,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-22T00:00:00.000Z","dateField":"createdAt","span":"week","type":"message","msg":"Computed conversation stats"}
{"level":30,"time":1727231014238,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"createdAt","span":"month","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014239,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"updatedAt","span":"month","type":"conversation","msg":"Computing conversation stats"}
{"level":30,"time":1727231014242,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"createdAt","span":"month","type":"conversation","msg":"Computed conversation stats"}
{"level":30,"time":1727231014243,"pid":23,"hostname":"fbe21dc3ad38","minDate":"2024-09-01T00:00:00.000Z","dateField":"updatedAt","span":"month","type":"conversation","msg":"Computed conversation stats"}
{"level":50,"time":1727231020662,"pid":23,"hostname":"fbe21dc3ad38","err":{"type":"TypeError","message":"fetch failed: getaddrinfo ENOTFOUND raw.githubusercontent.com","stack":"TypeError: fetch failed\n    at node:internal/deps/undici/undici:13178:13\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    atasync Promise.all (index 1)\n    at async Promise.all (index 0)\n    at async file:///app/build/server/chunks/index3-BP6IVcLY.js:174:63\ncaused by: Error: getaddrinfo ENOTFOUND raw.githubusercontent.com\n    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)"},"msg":"Failed to initialize PlaywrightBlocker from prebuilt lists"}
Using a model URL is deprecated, please use the `endpointUrl` parameter instead
Using a model URL is deprecated, please use the `endpointUrl` parameter instead
{"level":50,"time":1727231032591,"pid":23,"hostname":"fbe21dc3ad38","err":{"type":"Error","message":"Server response contains error: 403","stack":"Error: Server response contains error: 403\n    at streamingRequest (file:///app/node_modules/@huggingface/inference/dist/index.js:334:11)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async textGenerationStream (file:///app/node_modules/@huggingface/inference/dist/index.js:715:3)\n    at async generate (file:///app/build/server/chunks/_server.ts-D8UXwvVE.js:438:20)\n    at async textGenerationWithoutTitle (file:///app/build/server/chunks/_server.ts-D8UXwvVE.js:503:3)"},"msg":"Server response contains error: 403"}
{"level":50,"time":1727231032595,"pid":23,"hostname":"fbe21dc3ad38","err":{"type":"Error","message":"Server response contains error: 403","stack":"Error: Server response contains error: 403\n    at streamingRequest (file:///app/node_modules/@huggingface/inference/dist/index.js:334:11)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async textGenerationStream (file:///app/node_modules/@huggingface/inference/dist/index.js:715:3)\n    at async generateFromDefaultEndpoint (file:///app/build/server/chunks/index3-BP6IVcLY.js:1047:20)\n    at async generateTitle (file:///app/build/server/chunks/_server.ts-D8UXwvVE.js:198:10)\n    at async generateTitleForConversation (file:///app/build/server/chunks/_server.ts-D8UXwvVE.js:162:19)"},"msg":"Server response contains error: 403"}

The .env.local file provide is following:

MONGODB_URL=mongodb://mongodb:27017
PLAYWRIGHT_ADBLOCK=false
MODELS=`[{
  "name":"llama-modelname",
  "displayName":"llama-modelname",
  "description":"test",
  "parameters":{
     "max_new_tokens":100
  },
  "endpoints":[
    {
      "type":"aws",
      "service":"sagemaker",
      "url":"https://runtime.sagemaker.ap-southeast-2.amazonaws.com/endpoints/llama-modelname/invocations",
      "weight":1
    }
  ]
}]`

As there is no accesskey and id provided in .env file , assumption is the it would resolve the access using the ec2 instance profile attached to ec2 where above chat-ui container is running. The ec2 instance have the right role to involve the endpoint mentioned in above config.

Image used : huggingface/chat-ui :latest

Could you please suggest if this configuration is good to perform dynamic credentials resolution? As mentioned here - #1419

Thank you in advance!

@nauts nauts added the support A request for help setting things up label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support A request for help setting things up
Projects
None yet
Development

No branches or pull requests

1 participant