-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Unable to find packages.json on Windows Manual Install #4800
Comments
All of the above was on:
I downgraded back to Node v12.20.2 and the same problem occurs. |
Correct. I haven't used Windows in ages, so I don't know what the "right" fix is. The quick-and-dirty fix would be to replace |
Thanks @rhansen! Here's a summary list of the current issues that I ran into and the actions that I took to resolve them, in case this is helpful for the EP-lite team or anyone else trying to set up Windows in the short term.
This error was reported. Error: ENOENT: no such file or directory, open 'C:\Users\alexe\Downloads\etherpad-lite-develop-d7ed71e-2\etherpad-lite-develop\src\node\utils\tar.json' There was a hardcoded reference to the
Re-ran the server and it's running locally on my machine! |
Addition: I noticed that the skin directory wasn't found. Also adjusted
|
Nice spot, I will try to send a PR containing these fixes today :) |
Ah, most of these changes would break linux deployments so I'm not sure it's the right fix ;/ |
Yeah, I completely agree that this would break the linux deployments. I'm not at all familiar with Node development, so I'm just trying to keep notes of what I needed to adjust to get it to work on Windows. Is that helpful? |
yep, ty :) |
I tried installing a plugin, ep_copy_paste_images, via the admin plugin manager web page, and it crashed the server.
Restarting the server now fails due to dependency issues.
I assume this is probably related to moving the
I'm just working out of a folder right now, no change control, so I can't see the entire delta of this action. Any ideas? I have to run to a meeting, but I can debug later this afternoon if the answer isn't obvious. |
Yea this is due to the changes you made, 100%. I should be able to get @rhansen able to know the PR that broke the windows build. For a clean windows build you can just use...
then:
|
I got symbolic links working on Windows 10 Pro, so those steps above work like a dream now. I've been fighting with an Azure deployment most of the afternoon and evening. I reached out to Microsoft for support (using the support hours that my employer has available) and I'll consolidate those notes for the wiki too. The conversation should be happening here: https://docs.microsoft.com/en-us/answers/questions/277739/deployment-of-etherpad-lite-an-open-source-nodejs.html |
The patch for 1.8.8 is in and I'm going to be fixing import then releasing 1.8.9 tonight. |
I'm making progress with Azure. It's now starting a workflow in Github to do a deployment. I'm running into an issue with the package.json file. I think it's looking for this file in the site root, but it's located in Is it normal to have the packages.json in a non-root folder? Is this related to the bug fix you're working on? Here's the relevant output of the workflow.
|
Peep the windows ci branch. I'm working on it today |
Awesome! I'll hit pause on my efforts until you give me the thumbs up. I'm probably running into issues that you're addressing now. Thank you so much for your help! |
gimme a shout if that doesn't work btw it's not normal to have the |
There is a wealth of conflicting information online about Node.js on Azure. I haven't found anything in the official documentation, but there are many stackoverflow and Q&A pages that mention that package.json has to be in the root. Let me give it a try this afternoon and I'll report the outcome. Which branch should I be in at this point? Do you want me to stay in develop, main or switch to windows-server-ci? |
You can see the tests runner working fine on Microsoft Server there but IDK what Azure does different ;/ Myself and @rhansen just made it work on Microsoft infrastructure but from the sounds of things Azure does some specific things w/ NodeJS apps and sets certain expectations that we might not provide config for.. Do you wnat to jump on discord and we can see if we can figure it out in real time? Links on https://etherpad.org |
Awesome! Up and running locally with a new folder using these commands:
At this point, I could load the site on localhost:9001. Then I created a new repository in my personal Github, set the remote url, and checked in the latest.
I have an Azure App Service set up with a Windows server. I'm using the Deployment Center to create a Github integration for CI/CD. It creates the connection to the Github repo fine and creates a
This was failing because it couldn't find package.json. I modified three lines under
This still failed in Github workflow, but it wasn't a fatal error and the code was deployed to Azure. Once in Azure, I had some web.config issues that I think I resolved by deleting the web.config. There were issues caused by duplicated Now it appears to start running the server, but it stops without an error code and I'm returned an HTTP 500.1001 error: iisnode was unable to establish named pipe connection to the node.exe process. Below are the best logs I can find on the server. Any suggestions? I'm trying to get support from Azure again.
|
Oh wow you are getting far in! Good job.. So it looks like if it's stopped after version, it's not fully starting Etherpad.. after the line containing version after a few seconds you should get
Etherpad doesn't respect
remove these.. Unless you need to test before deployment, which would be weird?? |
Try this instead: - name: npm install, build, and test
run: |
cd src
npm ci
npm run build --if-present
npm run test --if-present
Are you sure that it stops? The line in the log that says " If it is indeed stopping but the logs don't show anything, I wonder if it's a Windows-specific log buffering issue. Maybe the process is dying and Windows isn't flushing buffered writes so you can't see the printed error message. |
Progress! Azure does not support symlinks. I copied There is a development console available for the App Service via the Azure Portal. I used this console to manually run the server and I got the actual error logs:
I tried to install the dependencies with
Output:
I ran |
Browsing the folder structure via FTP, it looks like |
@alexeisenhart in your CI build, you can set # File: .github/workflows/workflow.yml
name: JavaScript CI
on: [push]
env:
AZURE_WEBAPP_NAME: my-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: 'my-app-path' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '14.x' # set this to the node version to use
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm install, build, and test
run: |
# Build and test the project, then
# deploy to Azure Web App.
npm install
npm run build --if-present
npm run test --if-present
working-directory: my-app-path
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} When your app is deployed, there should be a web.config generated for you. You don't want to delete this file because for Windows hosting environments, it uses this file to run iisnode to host your node app. Azure will do it's best to determine how to run your application through package.json but you can configure command this in the Configuration Settings blade or by running The error you posted points to
If you removed the web.config, that could be the reason why. See https://docs.microsoft.com/en-us/azure/app-service/app-service-web-nodejs-best-practices-and-troubleshoot-guide#iisnode-http-status-and-substatus. |
Hey @RyanHill-MSFT. Thanks for the info. The Node.JS best practices link is new to me, and that looks very useful. At this point I'm running into application issues that I think are related to the symlinks. I think setting @JohnMcLear, I mentioned in my last post that I has copied
Output of starting the server:
|
@JohnMcLear made adjustments that resolve the symlink issues on Windows. At this point, I trashed this deployment, emptied the file storage and started fresh with download of https://github.com/ether/etherpad-lite/releases/download/1.8.9/etherpad-lite-win.zip, which has adjustments to deal with the symlink issue.
I tried to issue this command via the Azure Console and the Kudu CMD Console, but it repeatedly downloaded only 625 bytes. I downloaded this zip file locally, transferred it to the server via SFTP and then tried to extract it with I had to play with the web.configs a bit, and I don't have that working yet. But, in the Development Console (in the Azure App Service Portal), I can start @RyanHill-MSFT, below is the web.config that I have in the root of the site. The server file is located at
I monitor the log using Kudo and HTTP 500.1001 is now returned. The requested url is This application seems to require the port to be configured in a |
@RyanHill-MSFT, I think port binding is possibly the issue. From the best practices article that you shared, it recommends using
It looks like it's trying to bind to whatever value I have in the settings file, which I assume means that process.env.PORT is returning null? Here are some sample log files. Default port of 9001.
And I tried binding to 80, just in case there was some sort of port redirection happening.
|
That line sets the default value. The default is overridden by whatever you have in your |
@rhansen Thanks for the idea. I thought I tried that already, but I just retested. I commented out the port line from |
I just realized that npm version 1.1.37 is in the |
Hey @RyanHill-MSFT. Can you help here? I'm not getting the right NPM version at runtime. Where is NPM NPM Versions:
Where is NPM 6.12.0 located? |
Please enable DEBUG logging in your Etherpad attempts to run the npm executable that should be in the .zip file at |
@JohnMcLear I just realized that there might be a problem with the way we build the Windows zip. We run I updated our CI to build a Windows zip on Windows. @alexeisenhart Try downloading the |
@JohnMcLear Progress on the Azure side. I'm loading the correct version of NPM at runtime now (6.12.0), but Etherpad is still silently failing after it logs the npm version. I turned on debug logging, but nothing significant showed up in the log files. What happens after the npm version is printed? I don't have any plugins installed. Could it be a permissions issue? Does it create folder if it doesn't exist or something like that? When I run locally, the order of the log entries is different. For example, locally I have "Starting Etherpad..." logged before "npm --version: 6.14.11", however on Azure I see the npm version log, but I do not see "Starting Etherpad...". Similarly, locally I see "Running npm to get a list of installed plugins..." after "Starting Etherpad..." and before "npm --version" is logged, but I don't see "Running npm to get a list of installed plugins..." on the server either. I assume this is due to asynchronous threads, but is there a clue in this? I'm trying to trace through the code while adding new log entries to find where it's breaking down. I know you're out today, but I'd be open to any tips or hints when you get home! =) Here's the complete log from a fresh run from Azure this morning.
|
Progress so far. server.js -> in Azure, this test at the bottom is failing. I commented it out and just directly run start and it seems to get further.
It's breaking on interpreting the results of
Jumping into a meeting, but that's my morning progress. |
Wow well done mate |
Current issue: I can not load pads. Tried with Dirty.db and SQL Server databases. The page loads with HTTP 200 and displays the "Loading..." message, but the page never comes up. Lunch time, then I'll dig back into it. Client side loaded resources: Client side Javascript console errors: No reported errors server side. Server logs:
|
Try disable minify in settings.json |
@JohnMcLear Where can I learn more about require-kernel.js? It looks like it's a dynamically created file, because it's accessed at
If I navigate to Any suggestions? Edit: It looks like |
It looks like Etherpad is connected to a pipe. Might that introduce this issue? [32m[2021-02-24 19:15:11.545] [INFO] console - [39mYou can access your Etherpad instance at http://localhost:\.\pipe\9d4e4b8c-d103-49fc-890f-0d39f8af6eb9/ |
@alexeisenhart It should log 6.14.11, so something is still not working. Did you try the .zip I linked? Please paste debug logs during startup.
It's apparently trying to use a named pipe, but I don't think that's the right way to do it:
Would you please visit Ace2Editor.EMBEDED = Ace2Editor.EMBEDED || {};
Ace2Editor.EMBEDED["../static/js/require-kernel.js"] = "... really really long string with lots of code ..."; If not then I think there's a problem with pathname processing in |
#4867 artifact has the same issue
static/js/ace.js
/static/js/ace.js looking for embeds
/static/js/require-kernel.js
|
|
I set minify to
|
You probably did this, but if not ensure cache is disabled in develop console. The thing is, if we require a file via require-kernel that is not a package, but that is part of a package (like pad_utils.js), then yajsml will send a 307 redirect to that package. However, that redirect location does not include the version string, so that file can and will be served from the cache. That's the main reason elimination of 307s is important besides performance. This is probably worth fixing even though we're gonna drop yajsml/require-kernel in the future? It's probably not related to this bug though, as I see all version strings are included in the error trace you got. |
Yep browser cache is perma disabled for me obviously |
Interesting. The error from @alexeisenhart with rjquery is thrown from pad.html (before ace.js runs) while your error seems to be thrown later when initializing Ace2Editor. |
Hey @rhansen. I think I missed your previous comment requesting me to deploy your zip. The one that I'm currently running was sent to me two days ago by @JohnMcLear. I did not deploy the
I have my IP address configured as
Do you still need me to do these things, or is the information that John supplied sufficient? |
@alexeisenhart, See https://github.com/projectkudu/kudu/wiki/Node-versioning. Use |
@alexeisenhart What's the status? Were you able to get it working? |
Hey @rhansen. Not yet, but I haven't tried since Friday. I have to focus on personal things this weekend, but I'll be diving back in tomorrow morning. |
Describe the bug
I grabbed the latest changeset, d7ed71e, on the develop branch. I think issue #4787 has been resolved, but I'm getting an error that packages.json cannot be found.
Relevant snippet:
The file ep_etherpad-lite exists and the contents are "../src". If use a file explorer to navigate up one level and into /src, I find packages.json. I don't think Windows supports using a file for path redirection this way. I tried replacing ep_etherpad-lite with a shortcut, but that didn't work. I deleted ep_etherpad-lite, created a folder in its place and copied packages.json into this folder: that caused this issue to go away and start.bat seems to run successfully.
However, start.bat auto exits and returns to the command line and there doesn't appear to be a server running in the background. I don't know if that is a side effect of the change I described above. I then tried using node src/node/server.js to start the server instead, but auto-quits in the same way.
To Reproduce
The text was updated successfully, but these errors were encountered: