tickelton / docker-metatrader

MetaTrader4/5 in a container
ISC License
120 stars 52 forks source link

wine: failed to open "/MetaTrader/terminal.exe": c0000135 #7

Open shelomito12 opened 2 years ago

shelomito12 commented 2 years ago

Hi there, I'm not a Docker expert... can you please point me how/where to add the wine prefix WINEARCH=win32 for a 32-bit install of Metatrader4 within the Docker file?

$ docker run --net host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY -v $METATRADER_HOST_PATH:/MetaTrader --name mt tickelton/mt

002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0048:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0050:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0048:err:ole:start_rpcss Failed to open RpcSs service
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:fixme:imm:ImeSetActiveContext (0000000000030022, 0): stub
0050:fixme:imm:ImmReleaseContext (0000000000010020, 0000000000030022): stub
002c:fixme:imm:ImeSetActiveContext (000000000002004A, 1): stub
002c:fixme:imm:ImmReleaseContext (0000000000020046, 000000000002004A): stub
009c:fixme:imm:ImeSetActiveContext (000000000001008A, 1): stub
009c:fixme:imm:ImmReleaseContext (0000000000010092, 000000000001008A): stub
009c:fixme:urlmon:InternetBindInfo_GetBindString not supported string type 20
009c:fixme:file:NtLockFile I/O completion on lock not implemented yet
009c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
009c:err:mscoree:LoadLibraryShim error reading registry key for installroot
009c:err:mscoree:LoadLibraryShim error reading registry key for installroot
009c:err:mscoree:LoadLibraryShim error reading registry key for installroot
009c:err:mscoree:LoadLibraryShim error reading registry key for installroot
00ac:fixme:file:NtLockFile I/O completion on lock not implemented yet
00ac:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00ac:err:mscoree:LoadLibraryShim error reading registry key for installroot
00ac:err:mscoree:LoadLibraryShim error reading registry key for installroot
00ac:err:mscoree:LoadLibraryShim error reading registry key for installroot
00ac:err:mscoree:LoadLibraryShim error reading registry key for installroot
00bc:fixme:imm:ImeSetActiveContext (00000000000100B8, 1): stub
00bc:fixme:imm:ImmReleaseContext (00000000000300AE, 00000000000100B8): stub
00cc:fixme:imm:ImeSetActiveContext (00000000000300B4, 1): stub
00cc:fixme:imm:ImmReleaseContext (00000000000500C0, 00000000000300B4): stub
00ac:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
00ac:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
009c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
009c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1)
00dc:fixme:imm:ImeSetActiveContext (000000000002007C, 1): stub
00dc:fixme:imm:ImmReleaseContext (000000000003008A, 000000000002007C): stub
0128:fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet
0158:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
wine: configuration in L"/home/wine/.wine" has been updated.
0158:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0158:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
wine: failed to open "/MetaTrader/terminal.exe": c0000135

Install directory in Ubuntu (WLS2):

$ ls -ltr ~/MetaTrader$ ls -ltr
total 25264
drwxr-xr-x  2 user user     4096 Aug  3 16:58 config
-rw-r--r--  1 user user    23040 Aug  3 16:58 DDE-Sample.xls
drwxr-xr-x  6 user user     4096 Aug  3 16:58 history
drwxr-xr-x  7 user user     4096 Aug  3 16:58 profiles
drwxr-xr-x  2 user user     4096 Aug  3 16:58 Sounds
-rw-r--r--  1 user user    45126 Aug  3 16:58 terminal.ico
drwxr-xr-x  2 user user     4096 Aug  3 16:58 templates
-rwxr-xr-x  1 user user  9979144 Aug  3 16:58 metaeditor.exe
-rwxr-xr-x  1 user user 14524256 Aug  3 16:58 terminal.exe
drwxr-xr-x  2 user user     4096 Aug  3 16:58 symbolsets
-rwxr-xr-x  1 user user  1241048 Aug  3 16:58 uninstall.exe
drwxr-xr-x  2 user user     4096 Aug  3 16:58 logs
drwxr-xr-x  6 user user     4096 Aug  3 16:58 tester

https://forum.manjaro.org/t/wine-could-not-load-kernel32-dll-status-c0000135/69811

shelomito12 commented 2 years ago

I think this issue might be related to the UID/GID for the wine user since I don't see any wine/ directory created under home/

 RUN groupadd -g 1000 wine \
        && useradd -g wine -u 1000 wine \
        && mkdir -p /home/wine/.wine && chown -R wine:wine /home/wine \
        && env WINEARCH=win32 winecfg
tickelton commented 2 years ago

Check out this commit: https://github.com/tickelton/docker-metatrader/commit/d3af03ef8b0284bc51b4e7a0813a8ccc9da6819f

The Dockerfile used to only support 32bit Metatrader4 some time ago but was updated to support 64bit Metatrader 4 and 5. Since that's what almost everybody is using these days, 32bit support was dropped entirely. You might be able to get things to work with the Dockerfile from the above commit.

Let me know how that works for you, then maybe we can figure out a way to support both versions.

shelomito12 commented 2 years ago

1) If that is the case, then the following is not needed in the Dockerfile?

dpkg --add-architecture i386

2) I will start working with a trader and so far he recommended to install Metatrader4 with a demo account so I'm new to this platform... Can you provide a link where to download the 64bit version since some of the websites I visited don't mention/post a 64bit version, and I always end up with a 32bit version of it. -thanks

tickelton commented 2 years ago

Yes, you're right, the dpkg architecture is obsolete now.

I stopped using Metatrader a while ago in favour of more low level solutions so I'm not up to date with it and don't actually use this Dockerfile myself any longer. It seems like there is no official 64bit build of Metatrader4 any longer, only of Metatrader5.

That means that the latest version of this Dockerfile effectively only supports Metatrader5.

You can try just using the old version I referenced above. That might work for 32bit Metatrader4. If not it would probably be best to split this up into multiple Dockerfiles e.g. for MT4/32bit and MT5/64bit.

shelomito12 commented 2 years ago

Yes! It would be ideal (for people coming to this repo) to split this up into multiple Dockerfiles e.g. for MT4/32bit and MT5/64bit and put a note about it in the description.

Just as a fyi, this is my mt4 version which seems updated: image

Curious to know which low level solution you are using now? Can you maybe provide a reference? Is it open source (JavaScript / API)? 🙂

tickelton commented 2 years ago

I just pushed 9d90f2e34166bd671614c0862e2e07db826256d8 which splits the Dockerfile in two. One for MT4/32bit and one for MT5/64bit. I can't test the MT4/32bit setup myself since I don't have any suitable software or accounts any longer. Let me know if this works for you.

Curious to know which low level solution you are using now? Can you maybe provide a reference? Is it open source (JavaScript / API)?

I'm using a proprietary C++ framework that directly interfaces with various broker's FIX APIs (e.g. https://www.fxcm.com/markets/insights/fix-api/).