Obj, stl file upload failed in Local Development Environment

Hello, I’m a software developer using Speckle for the first time this time.

While looking for an open-source tool in the company, Speckle is suitable and is in test use.
The test environment is Windows 11, WSL2 Ubuntu 24.04.
Speckle server version was targeted at 2.22.5.
Node.js version is 18.19.1.

Currently, https://app.speckle.systems/ confirms that the file upload is good in general.
But in local development environment, no matter how hard I try, it doesn’t work.
Finally, I’m writing to get community help.

ifc files generally have no problem uploading files in local environment, but for obj and stl files, they are not uploaded due to two major problems.

No. 1: Missing module
The contents are in the requirements.txt file of the packages/fileimport-service in the root directory.

numpy-stl==3.1.1
specklepy==2.9.1
structlog==23.3.0
numpy==1.26.3 # not directly required, pinned to avoid a vulnerability in <1.22.2
python-util==1.2.1 # not directly required, peer dependency of numpy-stl

However, if I upload the obj, stl file, specklepy, stl module does not exist, console message shows “no module named”.
And then, I proceed with the related requirements.txt based installation in the python venv environment and try again, may be get No. 2 error for the obj file(stl file still exist same problem).

No. 2: Does not have auth token in ‘profile:read’ range due to GraphQL active_user null
I attach the specific log, and when I asked ChatGPT based on the related log, GPT told me as follows.

logging.txt (39.4 KB)

Problem Summary and Causes

  1. OBJ File Dependency Issue:
  • The log shows errors like Invalid filename reference in OBJ dependencies and Missing MTL file:/tmp/file_to_import/.
  • This indicates that the required MTL (Material Template Library) file is either missing or not correctly referenced. Without this file, the OBJ file might not render properly.
  1. GraphQL Authentication Error:
  • The error Your auth token does not have the required scope: profile:read was encountered.
  • This means the authentication token does not include the necessary profile:read scope, causing the GraphQL request to fail.
  1. Database Update Error:
  • The database threw an error: value too long for type character varying(255).
  • This suggests that the string being saved to the convertedMessage field exceeds the 255-character limit imposed by the database schema.

Solutions

  1. Resolving OBJ File Dependencies:
  • Ensure the required MTL file is included alongside the OBJ file in the same directory during the upload.
  • Check that the OBJ file’s mtllib directive correctly references the MTL file path.
  1. Fixing GraphQL Authentication:
  • Add the profile:read scope to the authentication token.
    • Verify the Speckle server’s user roles and API scope settings.
    • Generate a new token with the correct scope explicitly included.
  1. Addressing Database Field Length:
  • Update the database schema to allow longer messages:
    • Change the convertedMessage field to use a TEXT type or increase the length of character varying.
  • Alternatively, modify the application logic to truncate or limit the message length before saving.

Additional Recommendations

  • Review the Python script (import_file.py) handling the upload process for any issues in file handling or error propagation.
  • Ensure all paths and files referenced in the logs exist and are accessible by the server.

Apart from this, there is a phenomenon that the WSL2 on Windows mentioned in frontend-2, if I logged in and will not be redirected to the main page.

A Below partial content is .env file in frontend-2 directory. When I understood it, I thought it would be okay to comment the HOST env because it was told to remove it.

#HOST=127.0.0.1 # comment
PORT=8081

NUXT_PUBLIC_LOG_LEVEL=debug
NUXT_PUBLIC_LOG_PRETTY=true

# Whether to emit extra properties (bindings) that would be sent to seq to the console in CSR
NUXT_PUBLIC_LOG_CSR_EMIT_PROPS=false
...

I’ve been looking hard at community posts, but it’s not working out :frowning:
I’m writing to ask if I can get help.

NOTE: I am not good at English, so I had to use machine translation. Please understand.

Thank you.

1 Like

Hi @Yonggu

Welcome to Speckle’s community. Please do introduce yourself to the community, and let us know more about what you are hoping to achieve with Speckle, over at this thread: Introduce yourself 🙆

The local development environment is intended for those making changes to speckle server’s code, and for testing those changes.

If you are looking to use Speckle, and not develop its code, then you may be better deploying the pre-built Docker images using Docker Compose: Deploying a Server - Docker Compose | Speckle Docs

However, if you do wish to develop the file import service and run the local development environment then you will need to do the following:

No 1. Missing module

The STL and OBJ importers are written in Python, not Node.js, which complicates matters a little.

You will need python3 and pip on your path.
You will need to run pip install --requirement ./packages/fileimport-service/requirements.txt to install the missing Python modules.

No 2. Invalid token scopes

Authentication tokens in Speckle can be restricted to specific scopes or privileges.
When creating a new token, please select the profile:read privilege from the drop down menu.

I hope this helps,

Iain

1 Like

Thank you for helping. I was remove Ubuntu 24.04, and install Ubuntu 22.04.

When I installed the module with the Python command you mentioned, the obj and stl files were uploaded normally.
I made a token through the No. 2 process, but I’m not sure if it’s related.

In addition, do you need to check the frontend-2 part I mentioned separately? Thank you for your help.

1 Like