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

Server hangs and locks me out when I try to upload nupkg assets #346

Open
nirbhasa opened this issue Aug 8, 2023 · 0 comments
Open

Server hangs and locks me out when I try to upload nupkg assets #346

nirbhasa opened this issue Aug 8, 2023 · 0 comments

Comments

@nirbhasa
Copy link

nirbhasa commented Aug 8, 2023

I am running 2.1.3 on node version 19 (it doesnt install properly with 20).

The site is up and running, and I am able to create versions and flavours. However, when I run into an issue when adding assets, especially update assets.

On Windows it seems I can upload exe assets, but for nupkg the asset bar hangs at 0% (sometimes it goes to 30-40%), and then I get an 'unknown error' message. The site (and server) then hangs and I get a timeout message when trying to access server for about 20 minutes. It seems that some kind of firewall is in effect, but I cant see what (I am using brand new Debian 11 install)

The same happens when I try to publish using electron forge from Windows; I get this error: request to http://myserverip:1337/api/asset failed, reason: write ECONNRESET - which basically means site is unresponsive, and again I am locked out

It seems that it is writing the files to the filesystem (even at 0%, you can see it starts writing the file)

On server, I run everything as root. This is my local.js

module.exports = {
  appUrl: 'http://myserverip',
  auth: { static: { username: '******', password: '**************' },},
  jwt: { token_secret: '****************************************************************'},
  models: {
    datastore: 'postgresql',
    dataEncryptionKeys: { default: '*************************************************' },
  },
  datastores: {
    postgresql: {
      adapter: 'sails-postgresql',
      host: 'localhost',
      user: 'electron_release_server_user',
      password: ************',
      database: 'electron_release_server'
    }
  },
  session: {    // note: i had this issue before trying redis
    adapter: '@sailshq/connect-redis',
    secret: '****************************************************',
  },
  sockets: {  adapter: '@sailshq/socket.io-redis',  onlyAllowOrigins: ["myserverip:1337", "http://myserverip"] },
  files: { dirname: '/home/release-assets', },  
  port: process.env.PORT || 1337,
  environment: process.env.NODE_ENV || 'production',

Some other issues (which are probably not related, but I put here in case it somehow helps to fix the main issue)

Sessions

When trying to fix the above issues, I noticed I was getting the MemoryStore warning, so I tried to see if there is issue with postgres sessions. I had the following config, but it still kept using memorystore for sessions:

local.js

  session: {
    secret: '**********************************************',
    database: 'electron_release_server_sessions',
    host: 'localhost',
    user: 'electron_release_server_user',
    password: '**************',
    port: 5432
  },

session.js

module.exports.session = {
  postgresql: {
      adapter: 'v2land-sails-pg-session',
      host: 'localhost',
      user: 'electron_release_server_user',
      password: '*********************',
      database: 'electron_release_server'
  }
}

Then I tried unistalling pg_session_sails and installing v2land-sails-pg-session in main app and tried to use this config in session.js

module.exports.session = {
      adapter: 'v2land-sails-pg-session',
      host: 'localhost',
      user: 'electron_release_server_user',
      password: '*********************',
      database: 'electron_release_server'
}

The memory store warning disappears (so I appear to be using postgres session) then server just hangs when i try to access

so instead I just went with redis session as seen above, and commented out session.js entirely (if it doesnt cause problems, maybe redis is better suited to sessions, and easier to install?)

Nginx

I tried to use nginx proxy. I can access the site through http://myserverip, but it seems then I can write to the database but not read it. For example I can add versions/flavours, but I cant see them unless I stop nginx and access the site through http://myserverip:1337 (1337 is the port I am using)


This issue has some similarity to #305 but it seems I get a much different response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant