-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
Critical Error. One or more ports is not available. #2416
Comments
I've the same problem |
The problem seems to be with ruby not supporting some encodings (in my case CP720). Change it from here to English: It needs a restart afterward and I am not going to change it since I have programs that are dependent on this setting. Another way would be to use Windows API to change the encoding of the process but |
A workaround for this is to change the ruby's For version 2.7.0 of ruby, you should change the 72nd line. This works temporarily until the next version is out and this file gets replaced again. |
@falahati - wow, thanks so much for looking into this. Are you aware of any negative side effects for any user by skipping the local charmap discovery and nuking it with UTF 8? I wonder if there's a way to do this that doesn't require hacking Out of interest, does this error appear for you when you simply try and start |
Yes, unfortunately, the problem is not with the script but rather happens when Ruby is starting up. C:\Program Files\Sonic Pi\app\server\native\ruby\bin>ruby -e 'puts :hi'
Traceback (most recent call last):
13: from <internal:gem_prelude>:1:in `<internal:gem_prelude>'
12: from <internal:gem_prelude>:1:in `require'
11: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/rubygems.rb:1397:in `<top (required)>'
10: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/rubygems.rb:1397:in `require'
9: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/rubygems/defaults/operating_system.rb:3:in `<top (required)>'
8: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/singleton.rb:27:in `enable_dll_search_paths'
7: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:99:in `enable_dll_search_paths'
6: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:89:in `mingw_bin_path'
5: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:76:in `msys_path'
4: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:46:in `iterate_msys_paths'
3: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/site_ruby/2.7.0/ruby_installer/runtime/msys2_installation.rb:46:in `require'
2: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/win32/registry.rb:4:in `<top (required)>'
1: from C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/win32/registry.rb:72:in `<module:Win32>'
C:/Program Files/Sonic Pi/app/server/native/ruby/lib/ruby/2.7.0/win32/registry.rb:72:in `find': unknown encoding name - CP720 (ArgumentError) I believe a
@chcp 1252 >nul 2>&1
ruby.exe %* With mainwindow.cpp#L345 changed to: ruby_path = QDir::toNativeSeparators(root_path + "/app/server/native/ruby/bin/ruby.bat"); |
Excellent, thanks for this. Now can you try:
|
Already tried the #include <cstdio>
#include <array>
#include <cstdio>
#include <iostream>
#include <windows.h>
int main()
{
SetConsoleCP(1252);
SetConsoleOutputCP(1252);
auto pipe = _popen(
R"("C:\Program Files\Sonic Pi\app\server\native\ruby\bin\ruby.exe" -e 'puts :hi')",
"r"
);
if (!pipe) {
return -1;
}
std::array<char, 128> buffer{};
while (!feof(pipe)) {
if (fgets(buffer.data(), 128, pipe) != nullptr) {
std::cout << buffer.data();
}
}
return _pclose(pipe);
} Since nothing unicode is going through the ruby scripts anyway and since UTF-8 is backward compatible with CP-1252, I don't see a scenario in which forcing the UTF-8 encoding results in anything unexpected. However, I am also in agreement that modifying Edit: Suggested |
hmm, there must be a way of doing this that doesn't require such low-level manipulation and/or modifying However, when googling around I see the Given that we ship with our own version of Ruby, and provided it doesn't have any other negative side-effects, then this is something I'm happy to do for future versions. Do you think this only affects Windows, or perhaps it also affects macOS? |
BTW, I've patched this locally, so the next beta will ship with this fix. If there are no issues during the beta period, i'll ship the next version of Sonic Pi with this patched. So sorry you've had issues with encoding - it's important to me that Sonic Pi runs in as many locales as possible to lower the barriers to entry. Thanks so much for finding a fix and I really hope you have fun playing with it. Please do consider joining our friendly community: https://in-thread.sonic-pi.net |
I don't think this affects macOS, It works in my case but then again I never changed any regional setting on my Mac. To be specific, this seems to be mainly a problem with Windows since CP720 is an old DOS-era code page for Arabic and is superseded with Windows CP1256. Why Windows decided to use CP720 for Persian and not Arabic in Windows 10, 26 years after the last release of DOS is a mystery to me. I can't really expect ruby to support an old codepage from almost three decades ago. In any case, I still believe having a Windows only |
I have two concerns about making a batch script - firstly is ensuring that we get the correct pid for the process returned back (which would likely require a bit of extra piping work) and secondly setting the codepage to cp1256 for everyone might not be desirable? Unfortunately my knowledge in the area of codepages is pretty limited currently. However, I guess this concern is also similar to forcing the locale to UTF-8 in |
…for compatibility with systems using Arabic codepages. For more information: #2416
Closing for now - the next release will include a patched Ruby. |
Both Portable & msi windows 10
Critical Error. One or more ports is not available.
[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {05cab854-9d71-43ac-9884-6d2eb35ca27f}
[GUI] - Discovering port numbers...
[GUI] - Detecting port numbers...
[GUI] - GUI listen to server port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server listen to gui port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server incoming OSC cues port 0
[GUI] - port: 0 [Not Available]
[GUI] - Scsynth port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server send to GUI port 0
[GUI] - port: 0 [Not Available]
[GUI] - GUI send to server port 0
[GUI] - port: 0 [Not Available]
[GUI] - Scsynth send port 0
[GUI] - port: 0 [Not Available]
[GUI] - Erlang router port 0
[GUI] - port: 0 [Not Available]
[GUI] - OSC MIDI out port 0
[GUI] - port: 0 [Not Available]
[GUI] - OSC MIDI in port 0
[GUI] - port: 0 [Not Available]
[GUI] - Websocket port 0
[GUI] - port: 0 [Not Available]
[GUI] - Critical Error. One or more ports is not available.
Sonic Pi Boot Error Report
System Information
GUI Log
C:\Users\..\.sonic-pi\log\gui.log
Server Errors
C:\Users\..\.sonic-pi\log\server-errors.log
Server Output
C:\Users\...\.sonic-pi\log\server-output.log
Scsynth Output
C:\Users\..\.sonic-pi\log\scsynth.log
Process Log
C:\Users\..\.sonic-pi\log\processes.log
The text was updated successfully, but these errors were encountered: