HeyPuter / puter

🌐 The Internet OS! Free, Open-Source, and Self-Hostable.
https://puter.com
GNU Affero General Public License v3.0
24.79k stars 1.6k forks source link

Unable to see project after start #728

Open Koppeks opened 2 weeks ago

Koppeks commented 2 weeks ago

Issue Description After initialization with npm start, I am unable to use or access the app on the localhost:4100 (see screenshot 1) All the requests after opening the URL http://puter.localhost:4100/ returns status 304 (see screenshot 2) The console also is returning some errors (see screenshot 3)

Steps to Reproduce Unknown at the moment, I just forked the project up to date to my machine, npm install and npm start Specs: Windows 10, npm v10.8.2, node v22.5.1

Expected & Actual Behavior After npm start I should see the normal page like the website puter.com

Addition Information or Screenshots (if applicable) screenshot 1 image screenshot 2 image screenshot 3 image

Deployment

Puter version (if accessible)

Click the profile button on the top-right, then "Settings". The version number will be printed at the bottom

jelveh commented 2 weeks ago

Could you try in incognito and see if the problem persists?

Koppeks commented 2 weeks ago

It's the same behavior. Also in the console, there is a warning SYSTEM IS IN AN INVALID STATE

KernelDeimos commented 2 weeks ago

It's the same behavior. Also in the console, there is a warning SYSTEM IS IN AN INVALID STATE

When the console says that there should be an alarm id (it will look similar to a Puter username for generated users). Typing something like alarm:info funny-error-1122 will show the stack trace of the error. Can you paste a screenshot of that here?

[+] I'm testing a clone now, if that works I'm gonna try again on a Windows machine and see if that might be the issue.

Koppeks commented 2 weeks ago

image Should I type in the console alarm:info bold-wallet-1101 ?

KernelDeimos commented 2 weeks ago

image Should I type in the console alarm:info bold-wallet-1101 ?

Yep, that's the one! ([+] come to think of it, this error message will always be bold-wallet-1101 until we change how error ids are generated)

Koppeks commented 2 weeks ago

After alarm:info bold-wallet-1101 this is the result on the console. It says that it failed to initialize the database.


started: 2024-08-29T01:33:13.145Z
short id: bold-wallet-1101
original id: INVALID SYSTEM STATE:failed to initialize services
CompositeError: failed to initialize these services: database
    at Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:161:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- Inner error: CompositeError: failed to apply: 0003_user-permissions.sql at line 0
    at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:176:39)
    at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
    at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- Inner error: SqliteError: table `user_to_user_permissions` already exists
    at Database.exec (D:\Repositorios\puter\node_modules\better-sqlite3\lib\methods\wrappers.js:9:14)
    at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:173:41)
    at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
    at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- End of inner error
--- End of inner error
- error: CompositeError: failed to initialize these services: database
    at Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:161:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- Inner error: CompositeError: failed to apply: 0003_user-permissions.sql at line 0
    at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:176:39)
    at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
    at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- Inner error: SqliteError: table `user_to_user_permissions` already exists
    at Database.exec (D:\Repositorios\puter\node_modules\better-sqlite3\lib\methods\wrappers.js:9:14)
    at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:173:41)
    at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
    at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
    at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
--- End of inner error
--- End of inner error {
  innerErrors: [
    CompositeError: failed to apply: 0003_user-permissions.sql at line 0
        at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:176:39)
        at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
        at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
        at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
        at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
        at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
        at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
    --- Inner error: SqliteError: table `user_to_user_permissions` already exists
        at Database.exec (D:\Repositorios\puter\node_modules\better-sqlite3\lib\methods\wrappers.js:9:14)
        at SqliteDatabaseAccessService._init (D:\Repositorios\puter\src\backend\src\services\database\SqliteDatabaseAccessService.js:173:41)
        at async SqliteDatabaseAccessService.init (D:\Repositorios\puter\src\backend\src\services\BaseService.js:48:9)
        at async Container.init (D:\Repositorios\puter\src\backend\src\services\Container.js:153:17)
        at async Kernel._install_modules (D:\Repositorios\puter\src\backend\src\Kernel.js:147:13)
        at async D:\Repositorios\puter\src\backend\src\Kernel.js:125:13
        at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
        at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
    --- End of inner error {
      innerErrors: [Array],
      originalStackDescriptor: [Object]
    }
  ],
  originalStackDescriptor: {
    get: [Function (anonymous)],
    set: [Function (anonymous)],
    enumerable: false,
    configurable: true
  }
}```
KernelDeimos commented 2 weeks ago

Add NO_VAR_RUNTIME=1 to the beginning and see what happens; so something like NO_VAR_RUNTIME=1 npm start

Koppeks commented 2 weeks ago

Add NO_VAR_RUNTIME=1 to the beginning and see what happens; so something like NO_VAR_RUNTIME=1 npm start

The only thing that changed is this alert image

KernelDeimos commented 2 weeks ago

Add NO_VAR_RUNTIME=1 to the beginning and see what happens; so something like NO_VAR_RUNTIME=1 npm start

The only thing that changed is this alert

click ok, it should then bring up the login screen if my theory is accurate

[+] or hopefully a different error will show up in the console at least

Koppeks commented 2 weeks ago

I clicked ok and the alert just disappeared and no login screen appeared.

And I think this is a new error:

APIError {
  codes: {
    unknown_error: { status: 500, message: [Function: message] },
    format_error: { status: 400, message: [Function: message] },
    temp_error: { status: 400, message: [Function: message] },
    disallowed_value: { status: 400, message: [Function: message] },
    invalid_token: { status: 400, message: [Function: message] },
    disallowed_thing: { status: 400, message: [Function: message] },
    item_with_same_name_exists: { status: 409, message: [Function: message] },
    cannot_move_item_into_itself: { status: 422, message: 'Cannot move an item into itself.' },
    cannot_copy_item_into_itself: { status: 422, message: 'Cannot copy an item into itself.' },
    cannot_move_to_root: {
      status: 422,
      message: 'Cannot move an item to the root directory.'
    },
    cannot_copy_to_root: {
      status: 422,
      message: 'Cannot copy an item to the root directory.'
    },
    cannot_write_to_root: {
      status: 422,
      message: 'Cannot write an item to the root directory.'
    },
    cannot_overwrite_a_directory: { status: 422, message: 'Cannot overwrite a directory.' },
    cannot_read_a_directory: { status: 422, message: 'Cannot read a directory.' },
    source_and_dest_are_the_same: { status: 422, message: 'Source and destination are the same.' },
    dest_is_not_a_directory: { status: 422, message: 'Destination must be a directory.' },
    dest_does_not_exist: { status: 422, message: 'Destination was not found.' },
    source_does_not_exist: { status: 404, message: 'Source was not found.' },
    subject_does_not_exist: { status: 404, message: 'File or directory not found.' },
    shortcut_target_not_found: { status: 404, message: 'Shortcut target not found.' },
    shortcut_target_is_a_directory: {
      status: 422,
      message: 'Shortcut target is a directory; expected a file.'
    },
    shortcut_target_is_a_file: {
      status: 422,
      message: 'Shortcut target is a file; expected a directory.'
    },
    forbidden: { status: 403, message: 'Permission denied.' },
    immutable: { status: 403, message: 'File is immutable.' },
    field_empty: { status: 400, message: [Function: message] },
    field_missing: { status: 400, message: [Function: message] },
    xor_field_missing: { status: 400, message: [Function: message] },
    field_only_valid_with_other_field: { status: 400, message: [Function: message] },
    invalid_id: { status: 400, message: [Function: message] },
    invalid_operation: { status: 400, message: [Function: message] },
    field_invalid: { status: 400, message: [Function: message] },
    field_immutable: { status: 400, message: [Function: message] },
    field_too_long: { status: 400, message: [Function: message] },
    field_too_short: { status: 400, message: [Function: message] },
    already_in_use: { status: 409, message: [Function: message] },
    invalid_file_name: { status: 400, message: [Function: message] },
    storage_limit_reached: { status: 400, message: 'Storage capacity limit reached.' },
    internal_error: { status: 500, message: 'An internal error occurred.' },
    response_timeout: { status: 504, message: 'Response timed out.' },
    file_too_large: { status: 413, message: [Function: message] },
    thumbnail_too_large: { status: 413, message: [Function: message] },
    upload_failed: { status: 500, message: 'Upload failed.' },
    missing_expected_metadata: { status: 400, message: [Function: message] },
    overwrite_and_dedupe_exclusive: {
      status: 400,
      message: 'Cannot specify both overwrite and dedupe_name.'
    },
    not_empty: { status: 422, message: 'Directory is not empty.' },
    readdir_of_non_directory: { status: 422, message: 'Readdir target must be a directory.' },
    offset_without_existing_file: {
      status: 404,
      message: "An offset was specified, but the file doesn't exist."
    },
    offset_requires_overwrite: {
      status: 400,
      message: 'An offset was specified, but overwrite conditions were not met.'
    },
    offset_requires_stream: {
      status: 400,
      message: 'The offset option for write is not available for this upload.'
    },
    batch_too_many_files: {
      status: 400,
      message: 'Received an extra file with no corresponding operation.'
    },
    batch_missing_file: {
      status: 400,
      message: 'Missing fileinfo entry or BLOB for operation.'
    },
    invalid_file_metadata: { status: 400, message: 'Invalid file metadata.' },
    no_suitable_app: { status: 422, message: [Function: message] },
    app_does_not_exist: { status: 422, message: [Function: message] },
    app_name_already_in_use: { status: 409, message: [Function: message] },
    subdomain_limit_reached: { status: 400, message: [Function: message] },
    subdomain_reserved: { status: 400, message: [Function: message] },
    email_already_in_use: { status: 409, message: [Function: message] },
    username_already_in_use: { status: 409, message: [Function: message] },
    too_many_username_changes: { status: 429, message: 'Too many username changes this month.' },
    token_invalid: { status: 400, message: [Function: message] },
    interface_not_found: { status: 404, message: [Function: message] },
    no_implementation_available: { status: 502, message: [Function: message] },
    method_not_found: { status: 404, message: [Function: message] },
    missing_required_argument: { status: 400, message: [Function: message] },
    argument_consolidation_failed: { status: 400, message: [Function: message] },
    rate_limit_exceeded: { status: 429, message: [Function: message] },
    monthly_limit_exceeded: { status: 429, message: [Function: message] },
    server_rate_exceeded: {
      status: 503,
      message: 'System-wide rate limit exceeded. Please try again later.'
    },
    token_missing: { status: 401, message: 'Missing authentication token.' },
    token_auth_failed: { status: 401, message: 'Authentication failed.' },
    token_unsupported: {
      status: 401,
      message: 'This authentication token is not supported here.'
    },
    token_expired: { status: 401, message: 'Authentication token has expired.' },
    account_suspended: { status: 403, message: 'Account suspended.' },
    permission_denied: { status: 403, message: 'Permission denied.' },
    access_token_empty_permissions: {
      status: 403,
      message: 'Attempted to create an access token with no permissions.'
    },
    invalid_action: { status: 400, message: [Function: message] },
    '2fa_already_enabled': { status: 409, message: '2FA is already enabled.' },
    '2fa_not_configured': { status: 409, message: '2FA is not configured.' },
    too_many_requests: { status: 429, message: 'Too many requests.' },
    user_tokens_only: {
      status: 403,
      message: 'This endpoint must be requested with a user session'
    },
    temporary_accounts_not_allowed: {
      status: 403,
      message: 'Temporary accounts cannot perform this action'
    },
    password_required: { status: 400, message: 'Password is required.' },
    password_mismatch: { status: 403, message: 'Password does not match.' },
    field_not_allowed_for_create: { status: 400, message: [Function: message] },
    field_required_for_update: { status: 400, message: [Function: message] },
    entity_not_found: { status: 422, message: [Function: message] },
    user_does_not_exist: { status: 422, message: [Function: message] },
    invalid_username_or_email: { status: 400, message: [Function: message] },
    invalid_path: { status: 400, message: [Function: message] },
    future: { status: 400, message: [Function: message] },
    field_errors: { status: 400, message: [Function: message] },
    share_expired: { status: 422, message: 'This share is expired.' },
    email_must_be_confirmed: { status: 422, message: [Function: message] },
    no_need_to_request: {
      status: 422,
      message: 'This share is already valid for this user; POST to /apply for access.'
    },
    can_not_apply_to_this_user: {
      status: 422,
      message: 'This share can not be applied to this user.'
    },
    no_origin_for_app: { status: 400, message: 'Puter apps must have a valid URL.' },
    max_tokens_exceeded: { status: 400, message: [Function: message] }
  },
  status: 403,
  _message: 'Permission denied.',
  source: Error: error for trace
      at new APIError (D:\Repositorios\puter\src\backend\src\api\APIError.js:567:33)
      at APIError.create (D:\Repositorios\puter\src\backend\src\api\APIError.js:529:20)
      at DriverService._call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:162:28)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async DriverService.call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:106:20)
      at async D:\Repositorios\puter\src\backend\src\routers\drivers\call.js:74:16
      at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
      at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
      at async D:\Repositorios\puter\src\backend\src\routers\drivers\call.js:73:20
      at async errorHandledHandler (D:\Repositorios\puter\src\backend\src\api\eggspress.js:183:14),
  fields: { code: 'permission_denied' }
}

MESSAGE FROM ERROR: |Permission denied.|
Serialized error test {
  "code": "permission_denied",
  "$": "heyputer:api/APIError",
  "message": "Permission denied.",
  "status": 403
}
KernelDeimos commented 2 weeks ago

Somehow it still has a session token after logging out... not sure yet how that happened. Can you check local storage and cookies and see what's in there? Clearing site data will likely fix it but it would be nice to know what's getting stuck.

Koppeks commented 2 weeks ago

There is something named CALLED inside the console:

CALLED
?? undefined puter-kvstore get { key: 'user_preferences.auto_arrange_desktop' }
uh, groups? 8 []
group uids {}
issuer groups {
  'ca342a5e-b13d-4dee-9048-58b11a57cc55': { driver: {}, service: {}, feature: {}, 'kernel-info': {} },
  'b7220104-7905-4985-b996-649fdcdb3c8f': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  },
  '78b1b1dd-c959-44d2-b02c-8735671f9997': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  }
}

The APIError still is there and after the CALLED thing.

I deleted the cookies and the localStorage with no change in the result, the same dark bluish screen is shown every time.

KernelDeimos commented 2 weeks ago

Geez, I'm running out of ideas. I just tried a Windows computer and didn't run into this issue.

Check if you have a "C:\var\puter" directory. If this exists, back it up somewhere (if you have another Puter instance that you use on this computer) and remove this directory. NO_VAR_RUNTIME=1 is supposed to make Puter ignore this directory but maybe in Windows it doesn't work that way. Then try again, lmk if anything changes.

Koppeks commented 2 weeks ago

Geez, I'm running out of ideas. I just tried a Windows computer and didn't run into this issue.

I am used to running into weird stuff that no one has ever encounter hahaha

I deleted the D:\var\puter and pull, install and start the project. The same issue is shown on the console and the same results (background bluish app) In the console, most of the requests are status 304 with some exceptions of 200,

Some lines in the console refer to the username being null somewhere, just as I start the app. This is previous to any app rendered on the browser.

[INFO::__dev-watcher] (1.760s) Starting git:rollup-watch in D:\Repositorios\puter\src\git
command npx rollup -c rollup.config.js --watch
CALLED
?? undefined puter-kvstore get { key: 'tmp_password' }
uh, groups? 2 [
  {
    values: {
      id: 2,
      uid: 'ca342a5e-b13d-4dee-9048-58b11a57cc55',      
      owner_user_id: 1,
      extra: [Object],
      metadata: [Object],
      created_at: '2024-07-21 20:15:22'
    },
    get_client_value: [AsyncFunction: get_client_value],
    fetch_members: [AsyncFunction (anonymous)],
    context: Context { name: '6', parent_: [Context], values_: [Object] },
    services: Container {
      logger: [LogContext],
      instances_: [Object],
      implementors_: [Object],
      ready: [TeePromise],
      modname_: 'TestDriversModule',
      modules_: [Object]
    }
  }
]
group uids {
  'ca342a5e-b13d-4dee-9048-58b11a57cc55': {
    values: {
      id: 2,
      uid: 'ca342a5e-b13d-4dee-9048-58b11a57cc55',
      owner_user_id: 1,
      extra: [Object],
      metadata: [Object],
      created_at: '2024-07-21 20:15:22'
    },
    get_client_value: [AsyncFunction: get_client_value],
    fetch_members: [AsyncFunction (anonymous)],
    context: Context { name: '6', parent_: [Context], values_: [Object] },
    services: Container {
      logger: [LogContext],
      instances_: [Object],
      implementors_: [Object],
      ready: [TeePromise],
      modname_: 'TestDriversModule',
      modules_: [Object]
    }
  }
}
issuer groups {
  'ca342a5e-b13d-4dee-9048-58b11a57cc55': { driver: {}, service: {}, feature: {}, 'kernel-info': {} },
  'b7220104-7905-4985-b996-649fdcdb3c8f': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  },
  '78b1b1dd-c959-44d2-b02c-8735671f9997': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  }
}
permission? driver:puter-kvstore:get
permission? driver:puter-kvstore
permission? driver
TypeError: Cannot read properties of null (reading 'username')
    at PermissionService.grant_if_system (D:\Repositorios\puter\src\backend\src\structured\sequence\scan-permission.js:32:30)
    at SequenceState.run (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:141:51)
    at PermissionService.Sequence (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:263:25)
    at PermissionService.scan (D:\Repositorios\puter\src\backend\src\services\auth\PermissionService.js:239:14)
    at SequenceState.icall (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:221:39)
    at Object.scan (D:\Repositorios\puter\src\backend\src\unstructured\permission-scanners.js:136:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 2)
    at async PermissionService.run_scanners (D:\Repositorios\puter\src\backend\src\structured\sequence\scan-permission.js:85:9)
    at async SequenceState.run (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:141:37)
    at async PermissionService.Sequence (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:263:13)
    at async PermissionService.scan (D:\Repositorios\puter\src\backend\src\services\auth\PermissionService.js:238:9)
    at async DriverService._call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:159:25)
    at async DriverService.call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:106:20)
    at async D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:217:37
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
    at async DefaultUserService.get_tmp_password_ (D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:215:16)
    at async __on_ready.webserver (D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:84:30)
    at async DefaultUserService.__on (D:\Repositorios\puter\src\backend\src\services\BaseService.js:54:16)
    at async Promise.all (index 74)
    at async Container.emit (D:\Repositorios\puter\src\backend\src\services\Container.js:179:9)
    at async __on_boot.activation (D:\Repositorios\puter\src\backend\src\services\WebServerService.js:60:9)
    at async WebServerService.__on (D:\Repositorios\puter\src\backend\src\services\BaseService.js:54:16)
    at async Promise.all (index 6)
    at async Container.emit (D:\Repositorios\puter\src\backend\src\services\Container.js:179:9)
    at async Kernel._boot_services (D:\Repositorios\puter\src\backend\src\Kernel.js:204:9)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:126:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
?? undefined puter-kvstore set { key: 'tmp_password', value: 'd945f6fb' }
uh, groups? 2 [
  {
    values: {
      id: 2,
      uid: 'ca342a5e-b13d-4dee-9048-58b11a57cc55',
      owner_user_id: 1,
      extra: [Object],
      metadata: [Object],
      created_at: '2024-07-21 20:15:22'
    },
    get_client_value: [AsyncFunction: get_client_value],
    fetch_members: [AsyncFunction (anonymous)],
    context: Context { name: '6', parent_: [Context], values_: [Object] },
    services: Container {
      logger: [LogContext],
      instances_: [Object],
      implementors_: [Object],
      ready: [TeePromise],
      modname_: 'TestDriversModule',
      modules_: [Object]
    }
  }
]
group uids {
  'ca342a5e-b13d-4dee-9048-58b11a57cc55': {
    values: {
      id: 2,
      uid: 'ca342a5e-b13d-4dee-9048-58b11a57cc55',
      owner_user_id: 1,
      extra: [Object],
      metadata: [Object],
      created_at: '2024-07-21 20:15:22'
    },
    get_client_value: [AsyncFunction: get_client_value],
    fetch_members: [AsyncFunction (anonymous)],
    context: Context { name: '6', parent_: [Context], values_: [Object] },
    services: Container {
      logger: [LogContext],
      instances_: [Object],
      implementors_: [Object],
      ready: [TeePromise],
      modname_: 'TestDriversModule',
      modules_: [Object]
    }
  }
}
issuer groups {
  'ca342a5e-b13d-4dee-9048-58b11a57cc55': { driver: {}, service: {}, feature: {}, 'kernel-info': {} },
  'b7220104-7905-4985-b996-649fdcdb3c8f': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  },
  '78b1b1dd-c959-44d2-b02c-8735671f9997': {
    'service:hello-world:ii:hello-world': { policy: [Object] },
    'service:puter-kvstore:ii:puter-kvstore': { policy: [Object] },
    'driver:puter-kvstore': { policy: [Object] },
    'driver:puter-notifications': { policy: [Object] },
    'driver:puter-apps': { policy: [Object] },
    'driver:puter-subdomains': { policy: [Object] }
  }
}
permission? driver:puter-kvstore:set
permission? driver:puter-kvstore
permission? driver
TypeError: Cannot read properties of null (reading 'username')
    at PermissionService.grant_if_system (D:\Repositorios\puter\src\backend\src\structured\sequence\scan-permission.js:32:30)
    at SequenceState.run (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:141:51)
    at PermissionService.Sequence (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:263:25)
    at PermissionService.scan (D:\Repositorios\puter\src\backend\src\services\auth\PermissionService.js:239:14)
    at SequenceState.icall (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:221:39)
    at Object.scan (D:\Repositorios\puter\src\backend\src\unstructured\permission-scanners.js:136:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 2)
    at async PermissionService.run_scanners (D:\Repositorios\puter\src\backend\src\structured\sequence\scan-permission.js:85:9)
    at async SequenceState.run (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:141:37)
    at async PermissionService.Sequence (D:\Repositorios\puter\src\backend\src\codex\Sequence.js:263:13)
    at async PermissionService.scan (D:\Repositorios\puter\src\backend\src\services\auth\PermissionService.js:238:9)
    at async DriverService._call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:159:25)
    at async DriverService.call (D:\Repositorios\puter\src\backend\src\services\drivers\DriverService.js:106:20)
    at async D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:226:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
    at async DefaultUserService.get_tmp_password_ (D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:215:16)
    at async __on_ready.webserver (D:\Repositorios\puter\src\backend\src\modules\selfhosted\DefaultUserService.js:84:30)
    at async DefaultUserService.__on (D:\Repositorios\puter\src\backend\src\services\BaseService.js:54:16)
    at async Promise.all (index 74)
    at async Container.emit (D:\Repositorios\puter\src\backend\src\services\Container.js:179:9)
    at async __on_boot.activation (D:\Repositorios\puter\src\backend\src\services\WebServerService.js:60:9)
    at async WebServerService.__on (D:\Repositorios\puter\src\backend\src\services\BaseService.js:54:16)
    at async Promise.all (index 6)
    at async Container.emit (D:\Repositorios\puter\src\backend\src\services\Container.js:179:9)
    at async Kernel._boot_services (D:\Repositorios\puter\src\backend\src\Kernel.js:204:9)
    at async D:\Repositorios\puter\src\backend\src\Kernel.js:126:13
    at async D:\Repositorios\puter\src\backend\src\util\context.js:118:20
    at async Context.arun (D:\Repositorios\puter\src\backend\src\util\context.js:116:16)
CALLED
[INFO::__dev-watcher] (2.495s) [puter.js:webpack-watch:1]
[INFO::__dev-watcher] (2.498s) [puter.js:webpack-watch:1] > @heyputer/puterjs@1.0.0 start-webpack

[+] Is there anything that is recommended to install to run the app? Like Docker for example.

KernelDeimos commented 2 weeks ago

[+] Is there anything that is recommended to install to run the app? Like Docker for example.

Tbh my recommendation is WSL or Linux. We've done very little testing in Windows environments.

Koppeks commented 2 weeks ago

When I first ran the project I had Win11, then switched to Ubuntu 24 lts and 22 lts, and now I am using Win10. In all of those OS, I had the same bold-wallet-1101 error. That's why I am asking, I will try again with WSL and see if it works. If doesn't, well I can´t collaborate with this project 😞

KernelDeimos commented 2 weeks ago

When I first ran the project I had Win11, then switched to Ubuntu 24 lts and 22 lts, and now I am using Win10. In all of those OS, I had the same bold-wallet-1101 error. That's why I am asking, I will try again with WSL and see if it works. If doesn't, well I can´t collaborate with this project 😞

I would really like to reproduce this so we can get it fixed. Is there any chance you can provide a Dockerfile that reproduces the issue or a video with exact reproduction steps?

Koppeks commented 1 week ago

Video context: https://vimeo.com/1005567965?share=copy

I had the project forked on my github, I was executing that forked project (up to date from puter/main) and the result was the error INVALID SYSTEM STATE, now I clone the main project, and that error is gone and a new one called FAILED TO GET THE CORRECT CONTEXT.

Either way, I cannot make any changes, add files, or save anything on the localhost. Is this could be that the project doesn't have the context to save anything on the DB.

Is there any chance you can provide a Dockerfile that reproduces the issue or a video with exact reproduction steps?

I never used docker so what do you need exactly to debug this issue?

KernelDeimos commented 1 week ago

I wasn't able to reproduce by using a fork, I'll try later on a Windows computer.

I don't notice anything in the server console that explains the error editing files. What shows up in the browser dev console?

Koppeks commented 1 week ago

What shows up in the browser dev console?

On the console at the start only appears this log Failed to load resource: the server responded with a status of 404 (Not Found) on this route http://api.puter.localhost:4100/read?file=~%2F.__puter_gui.json When I search for that route the response is that the Auth token is missing image

When I went to check the cookies and the local storage both contained the auth_token Cookies: image LocalStore: image

All this is before opening or saving any file inside the app.

This is the first that appears on the console when I open a file (Not saving or writing inside). image

KernelDeimos commented 1 week ago

I can explain your observations, unfortunately none yet indicate the issue (except perhaps the socket.io error, in which case I'd expect that files do get written but you don't see new files pop up until you reload - is this accurate?)

What happens when you try to save a file? I assume there must be a console error that comes up if the save isn't successful.

KernelDeimos commented 1 week ago

btw I tried running in a clean Ubuntu install in a VM. It works but the first time I loaded the page I got the BSOL and had to press reload to get the full gui.

Koppeks commented 1 day ago

After all, my only guess is that my hardware has the issue. There are no other explanations for this bug I have. It's only happening to me, through 3 different OS, also you don't find the probable cause. Thanks for giving time and effort to fix this 💪